A
aaycsdn
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.BitBtn1Click(Sender: TObject);
var t1,i,j,s:integer;
begin
s:=0;
t1:=GetTickCount;
with image1.Picture do begin
for i:=0 to Width -1 do
for j:=0 to Height -1 do
if Bitmap.Canvas .Pixels[i,j]=clred then
s:=s+1;
end;
t1:=GetTickCount-t1;
end;
结果,图象为200*200的,用120-130ms!
如何才能提高速度?
var t1,i,j,s:integer;
begin
s:=0;
t1:=GetTickCount;
with image1.Picture do begin
for i:=0 to Width -1 do
for j:=0 to Height -1 do
if Bitmap.Canvas .Pixels[i,j]=clred then
s:=s+1;
end;
t1:=GetTickCount-t1;
end;
结果,图象为200*200的,用120-130ms!
如何才能提高速度?