Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy all the pixels in a circle on a BITMAP image and paste to another spot on the image? [closed]

Tags:

delphi

I am trying to copy an area (circle) on an image to another part of the image. (Like shown below)

Example Image

Something similar is the CopyRect procedure. The only difference is the shape.

like image 860
Xander Terblanche Avatar asked Apr 24 '17 18:04

Xander Terblanche


1 Answers

  • Create clipping region (CreateEllipticRgn here, CombineRgn for more complex figures)
  • Select it (SelectClipRgn) in destination device context (Canvas.handle).
  • Copy rectangle containing needed fragment. Parts outside clip region remain the same.
  • Remove clipping region
like image 200
MBo Avatar answered Nov 15 '22 03:11

MBo