Advertisement
mixster

mixster

Dec 28th, 2008
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.30 KB | None | 0 0
  1. procedure DrawSomethingDunDunDun(var img: TImage; wl, hl: Integer);
  2. var
  3.   a, b, x, y, ws, hs: Integer;
  4.   ex, ey: Extended;
  5. begin
  6.   with img.Canvas do
  7.   begin
  8.     ws := img.Width / wl;
  9.     hs := img.Height / hl;
  10.     Pen.Color := clBlack;
  11.     for b := 0 to hl - 1 do
  12.     begin
  13.       for a := 1 to wl do
  14.       begin
  15.         ex := (a * ws) - (ws / 2);
  16.         ey := (b * hs) + (b * (hs / 3));
  17.         x := Round(ex);
  18.         y := Round(ey);
  19.         MoveTo(x, y);
  20.         DecEx(ex, ws / 2);
  21.         IncEx(ey, hs / 3);
  22.         x := Round(ex);
  23.         y := Round(ey);
  24.         LineTo(x, y);
  25.         IncEx(ey, hs / 3);
  26.         y := Round(ey);
  27.         LineTo(x, y);
  28.         IncEx(ex, ws / 2);
  29.         IncEx(ey, hs / 3);
  30.         x := Round(ex);
  31.         y := Round(ey);
  32.         LineTo(x, y);
  33.         IncEx(ey, hs / 3);
  34.         y := Round(ey);
  35.         LineTo(x, y);
  36.         DecEx(ey, hs / 3);
  37.         y := Round(ey);
  38.         MoveTo(x, y);
  39.         IncEx(ex, ws / 2);
  40.         DecEx(ey, hs / 3);
  41.         x := Round(ex);
  42.         y := Round(ey);
  43.         LineTo(x, y);
  44.         DecEx(ey, hs / 3);
  45.         y := Round(ey);
  46.         LineTo(x, y);
  47.         DecEx(ex, ws / 2);
  48.         DecEx(ey, hs / 3);
  49.         x := Round(ex);
  50.         y := Round(ey);
  51.         LineTo(x, y);
  52.       end;
  53.     end;
  54.   end;
  55. end;   
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement