注册 登录
编程论坛 Delphi论坛

[求助]请教如何将IMAGE.CANVAS画布上的东西一次性清除掉

nantiangumo 发布于 2007-07-12 01:42, 5673 次点击
form1.Image1.Canvas.FloodFill(520,300,clYellow,fsBorder); //这行可以画布以前的东西清除干净
form1.Image1.Canvas.Font.Color := clYellow;
form1.Image1.Canvas.Font.Size := 18;
form1.Image1.Canvas.TextOut(100,130,'MCU Chip Erasing ......');
Sleep(2000);
// ChipErase();
form1.Image1.Canvas.FloodFill(520,300,clYellow,fsBorder); //但在这行清除不掉前两行输出的'MCU Chip Erasing ......'
form1.Image1.Canvas.TextOut(120,130,'MCU Chip Erased !'); //这行只是覆盖上一行打印的字符串的中间一部分


请问用什么函数来清除画布上的东西,然后FLOODFILL是什么函数?
谢谢赐教!
3 回复
#2
nantiangumo2007-07-12 01:44
补充:为什么前后两行几乎同时打印到画布,Sleep(2000)根本起不到延时作用。
#3
anthony6342007-07-12 11:20

se FloodFill to fill a possibly non-rectangular region of the image with the value of Brush.

fsSurface Fill all area that has the color indicated by the Color parameter. Stop when another color is encountered.
fsBorder Fill all area that does not have the color indicated by the Color parameter. Stop when Color is encountered.

#4
anthony6342007-07-12 11:25

procedure cleanCurCanvas();

begin
with image1.Canvas do
begin
Brush.Style := bsSolid;
brush.color := clWhite;
FillRect(ClientRect);
end;

end;

直接在这里写的,没编译过,你可以试下行不行

[此贴子已经被作者于2007-7-12 11:26:39编辑过]

1