| Cutting a graphic to the Clipboard is like copying it, but you also erase the graphic from the source. procedure CutToClipboard
(AnImage:TImage; ARect:TRect) ;
var b:TBitmap;
begin
//first copy
b:=TBitmap:Create;
try
b.Width := ARect.Width;
b.Height := ARect.Height;
CopyRect(Rect(0,0,b.Height,b.Width),
AnImage.Canvas, ARect) ;
Clipboard.Assign(b)
finally
b.Free
end;
//than cut
with AnImage.Canvas do
begin
CopyMode := cmWhiteness;
CopyRect(ARect, AnImage.Canvas, ARect) ;
CopyMode := cmSrcCopy;
end;
end; |