4 个解决方案
#1
Canvas.Brush.Style=bsClear;
#2
procedure TForm1.DrawShape(Cnvs: Tcanvas; TopLeft, BottomRight: TPoint; AMode: TPenMode);
begin
with Cnvs do
begin
Pen.Mode := AMode;
Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y);
end;
end;
DrawShape(Cnvs, NowTopLeft, NowBottomRight, pmNotXor);
begin
with Cnvs do
begin
Pen.Mode := AMode;
Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y);
end;
end;
DrawShape(Cnvs, NowTopLeft, NowBottomRight, pmNotXor);
#3
此贴又提前了?一楼的方法就可以啊!
with Self.Canvas do
begin
Pen.Color := clRed;
Pen.Width := 1;
Brush.Style := bsClear;
//Brush.Color := self.Color; //或这样
Rectangle(Rect(20,20,100,100));
end;
with Self.Canvas do
begin
Pen.Color := clRed;
Pen.Width := 1;
Brush.Style := bsClear;
//Brush.Color := self.Color; //或这样
Rectangle(Rect(20,20,100,100));
end;
#4
一楼是对的,我试过了,又学了一招,嘿嘿。。。
#1
Canvas.Brush.Style=bsClear;
#2
procedure TForm1.DrawShape(Cnvs: Tcanvas; TopLeft, BottomRight: TPoint; AMode: TPenMode);
begin
with Cnvs do
begin
Pen.Mode := AMode;
Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y);
end;
end;
DrawShape(Cnvs, NowTopLeft, NowBottomRight, pmNotXor);
begin
with Cnvs do
begin
Pen.Mode := AMode;
Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X, BottomRight.Y);
end;
end;
DrawShape(Cnvs, NowTopLeft, NowBottomRight, pmNotXor);
#3
此贴又提前了?一楼的方法就可以啊!
with Self.Canvas do
begin
Pen.Color := clRed;
Pen.Width := 1;
Brush.Style := bsClear;
//Brush.Color := self.Color; //或这样
Rectangle(Rect(20,20,100,100));
end;
with Self.Canvas do
begin
Pen.Color := clRed;
Pen.Width := 1;
Brush.Style := bsClear;
//Brush.Color := self.Color; //或这样
Rectangle(Rect(20,20,100,100));
end;
#4
一楼是对的,我试过了,又学了一招,嘿嘿。。。