Advertisement
mixster

mixster

Jan 2nd, 2009
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.13 KB | None | 0 0
  1. var
  2.   c, t: TCanvas;
  3.   l, h, w, i, ii, b: Integer;
  4. begin
  5.   Writeln('Begin');
  6.   l := Round(Sqrt(50));
  7.   h := Round(200.0 / ((Sqrt(50.0) * 2.0) + 20.0)) - 1;
  8.   w := Round(200.0 / (Sqrt(50.0) * 2.0)) - 1;
  9.   b := BitmapFromString(15, 25, '');
  10.   FastDrawClear(b, clWhite);
  11.   t := GetBitmapCanvas(b);
  12.   t.Pen.Color := clBlack;
  13.   t.Pen.Width := 0;
  14.   t.Brush.Color := clRed;
  15.   t.Polygon([Point(l, 0), Point(0, l), Point(0, l + 10), Point(l, (2 * l) + 10), Point(2 * l, l + 10), Point(2 * l, l), Point(l, 0)]);
  16.   l := BitmapFromString(200, 200, '');
  17.   FastDrawClear(l, clWhite);
  18.   SetTransparentColor(b, clWhite);
  19.  
  20.   for i := 0 to h do
  21.     for ii := 0 to w do
  22.     begin
  23.       FastDrawTransparent(Round(ii * 2.0 * Sqrt(50.0)), Round(i * ((Sqrt(50.0) * 2.0) + 20.0)), b, l);
  24.       if (i < h) and (ii < w) then
  25.         FastDrawTransparent(Round(ii * 2.0 * Sqrt(50.0)) + Round(Sqrt(50)), Round(i * ((Sqrt(50.0) * 2.0) + 20.0)) + Round(Sqrt(50)) + 10, b, l);
  26.     end;
  27.   DisplayDebugImgWindow(200, 200);
  28.  
  29.   c := GetDebugCanvas;
  30.   c.Brush.Color := clWhite;
  31.   c.Rectangle(0, 0, 110, 110);
  32.   SafeDrawBitmap(l, c, 0, 0);
  33.   Writeln('End.');
  34. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement