0

So I am trying the get a shape to fill a gap created by other shapes in a C#.NET Winforms program. Shapes are created using e.Graphics paintevent args, e.g. e.Graphics.DrawEllipse() with x, y, width and height parameters.

So basically a simple case might be a large outer circle, with two smaller circles inside touching each other and the outside circumference. I want to be able to define a shape of the blue region in the image below.

I guess I would need to use some sort of Boolean operations such as subtract but difficult to get only the blue region as the area that isn't required outside the two circles isn't defined.

Once created, I would then need to be able to get properties of that region, such as cross-sectional area.

Image

Any ideas anyone? Any help would be much appreciated.

  • 1
    See the Remarks section of the [GraphicsPath Class](https://learn.microsoft.com/en-us/dotnet/api/system.drawing.drawing2d.graphicspath) (the Clipping Regions reference, most of all) – Jimi Dec 22 '20 at 20:40
  • 1
    Well, there's an answer that addresses a topic quite similar to yours: [How to paint a certain area](https://stackoverflow.com/a/49965548/7444103) – Jimi Dec 22 '20 at 20:45
  • If you want the geometry of the region, rather than to just display it, look at http://www.angusj.com/delphi/clipper.php... but you'll have to turn those ellipses into a set of lines. – MineR Dec 22 '20 at 22:57

0 Answers0