W
wenlong111
Unregistered / Unconfirmed
GUEST, unregistred user!
如何擦去透明画布上的图形?
我已经在一透明画布上画了一个图形,我如何才能把已经画上的图形擦去?
paint函数中:
var
Slika : Tbitmap;
x1,x2,x3,x4,y1,y2,y3,y4:integer;
begin
Slika:=TBitmap.Create;
Slika.Width:=ClientWidth;
Slika.Height:=ClientHeight;
slika.Transparent:=true;
with Slika.Canvas do begin
Color:=fBackColor;
Brush.Style:=bsclear;
FillRect(Rect(0,0,Slika.Width,Slika.Height));
end;
x1:=2;
y1:=2;
x2:=12;
y2:=2;
x3:=12;
y3:=12;
x4:=2;
y4:=12;
polyLine([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4),Point(x1,y1)]);
FloodFill(((x1+x2)div 2),((y1+y4)div 2),Brush.Color, fsBorder);
Canvas.CopyMode:=cmSrcCopy;
Canvas.Draw(0, 0, Slika);
Slika.Free;
end;
我已经在一透明画布上画了一个图形,我如何才能把已经画上的图形擦去?
paint函数中:
var
Slika : Tbitmap;
x1,x2,x3,x4,y1,y2,y3,y4:integer;
begin
Slika:=TBitmap.Create;
Slika.Width:=ClientWidth;
Slika.Height:=ClientHeight;
slika.Transparent:=true;
with Slika.Canvas do begin
Color:=fBackColor;
Brush.Style:=bsclear;
FillRect(Rect(0,0,Slika.Width,Slika.Height));
end;
x1:=2;
y1:=2;
x2:=12;
y2:=2;
x3:=12;
y3:=12;
x4:=2;
y4:=12;
polyLine([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4),Point(x1,y1)]);
FloodFill(((x1+x2)div 2),((y1+y4)div 2),Brush.Color, fsBorder);
Canvas.CopyMode:=cmSrcCopy;
Canvas.Draw(0, 0, Slika);
Slika.Free;
end;