program project1;
uses
SysUtils, fpImage, fpCanvas, fpImgCanv;
const
WIDTH = 10*1000;
HEIGHT = 10*1000;
var
t: TDateTime;
img: TFPCustomImage;
cnv: TFPCustomCanvas;
i, x, y: Integer;
begin
for i := 1 to 5 do
begin
WriteLn('Run #', i);
img := TFPMemoryImage.Create(WIDTH, HEIGHT);
try
cnv := TFPImageCanvas.Create(img);
try
Write(' outer loop x...: ');
t := Now;
for x:=0 to img.Width-1 do
for y:=0 to img.Height-1 do
cnv.Colors[x,y] := colTransparent;
t := Now-t;
WriteLn(FormatDateTime('s.zzz" seconds"', t));
Write(' outer loop y...: ');
t := Now;
for y:=0 to img.Height-1 do
for x:=0 to img.Width-1 do
cnv.Colors[x,y] := colTransparent;
t := Now-t;
WriteLn(FormatDateTime('s.zzz" seconds"', t));
finally
cnv.Free;
end;
finally
img.Free;
end;
WriteLn;
end;
Write('Done. Press ENTER to quit...');
ReadLn;
end.