Recent Posts
Selamat datang di Coding Delphi Land Weblog kumpulan source code pemogram delphi
(Bukan maksud untuk menggurui tetapi marilah kita berbagi ilmu tuk perkembangan kemajuan teknologi kita
Selasa, 17 November 2009
Fill Rectangle Scanline Method
procedure TForm1.BitBtn6Click(Sender: TObject);
//scanline fill timing
type PDW = ^DWORD;
var i : integer;
x,y : byte;
k : word;
p,pbase : PDW;
begin
clearBM;
t1 := gettickCount;
for k := 1 to 10000 do
for y := 0 to 99 do
begin
pbase := bm.scanline[y];
for x := 0 to 99 do
begin
p := PDW(DWORD(pbase) + (x shl 2));
p^ := $ff00ff;
end;
end;
t2 := gettickcount;
showtime(100000000);
end;
//scanline fill timing
type PDW = ^DWORD;
var i : integer;
x,y : byte;
k : word;
p,pbase : PDW;
begin
clearBM;
t1 := gettickCount;
for k := 1 to 10000 do
for y := 0 to 99 do
begin
pbase := bm.scanline[y];
for x := 0 to 99 do
begin
p := PDW(DWORD(pbase) + (x shl 2));
p^ := $ff00ff;
end;
end;
t2 := gettickcount;
showtime(100000000);
end;
0 komentar:
Posting Komentar