//抽点逐渐显示
procedure TForm1.Button2Click(Sender: TObject);
begin
form1.repaint;
for n:=0 to 1 do
for m:=0 to 1 do
for j:=0 to bitmap.height div 2 do
for i:=0 to bitmap.width div 2 do
begin
with rect1 do begin
left:=2*i+m;
top:=2*j+n;
right:=2*i+1+m;
bottom:=2*j+1+n;
end; with rect3 do
begin
left:=2*i+m;
top:=2*j+n;
right:=2*i+1+m;
bottom:=2*j+1+n;
end;
canvas.copyrect(rect3,bitmap.canvas,rect1);
end;
end;
//缩小四分之一
procedure TForm1.Button3Click(Sender: TObject);
begin
form1.repaint;
for j:=0 to bitmap.height div 2 do
for i:=0 to bitmap.width div 2 do
begin
with rect1 do
begin
left:=2*i;
top:=2*j;
right:=2*i+1;
bottom:=2*j+1;
end;
with rect3 do
begin
left:=i;
top:=j;
right:=i+1;
bottom:=j+1;
end;
canvas.copyrect(rect3,bitmap.canvas,rect1);
end;
end;