1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
| var SourceBitmap : TBitmap; TargetBitmap : TBitmap; cut: TRect;
begin if ssright in Shift then begin
cut.Top := Panel1.Top; cut.Left := Panel1.Left; cut.BottomRight.X := Panel1.Top + Panel1.Height; cut.BottomRight.Y := Panel1.left + Panel1.Width; SourceBitmap:= TBitmap.Create; TargetBitmap:= TBitmap.Create; SourceBitmap := Image1.picture.bitmap; TargetBitmap := Image2.picture.Bitmap; TargetBitmap.Width := Cut.Right - Cut.Left; TargetBitmap.Height := Cut.Bottom - Cut.Top;
BitBlt(TargetBitmap.Canvas.Handle, 0, 0, Cut.Right, Cut.Bottom, SourceBitmap.Canvas.Handle, Cut.Left, Cut.Top, SRCCOPY); SourceBitmap.Canvas.Refresh; Image1.picture.bitmap := image2.picture.bitmap; end; end; |