主要是设置 CopyMode,当然你可以设置其它值,做一个Mask的图像。
procedure TForm1.ImageClick(Sender: TObject);
var
ARect: TRect;
begin
with Image.Canvas do
begin
CopyMode := cmDstInvert;
ARect := Rect(0, 0, Image.Width, Image.Height);
CopyRect(ARect, Image.Canvas, ARect);
// CopyMode := cmSrcCopy; { restore the copy mode }
end;
end;