Advertisement
mixster

mixster

Oct 10th, 2008
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.65 KB | None | 0 0
  1. var
  2.   t, bmp, x, y: Integer;
  3.   a, b, r: Extended;
  4.   cnv: TCanvas;
  5. begin
  6.   t := GetSystemTime;
  7.   bmp := BitmapFromString(360, 360, '');
  8.   DisplayDebugImgWindow(360, 360);
  9.   cnv := GetBitmapCanvas(bmp);
  10.   with cnv do
  11.     for y := 0 to 360 do
  12.       for x := 0 to 360 do
  13.       begin
  14.         if (x = 180) or (y = 180) then
  15.           Continue;
  16.         a := Abs(180 - x);
  17.         b := Abs(180 - y);
  18.         r := 90 - Tan(b / a);
  19.         Pixels[x, y] := HSLToColor(a * 2, b * 2, r / 3.6);
  20.       end;
  21.   SafeDrawBitmap(bmp, GetDebugCanvas, 0, 0);
  22.   FreeBitmap(bmp);
  23.   t := GetSystemTime - t;
  24.   Writeln('Took ' + IntToStr(t) + 'ms to generate image');
  25. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement