I need to get a Gdi+ Region from a GraphicPath without filling it, and I don't know how to do it.
A draw is better than words, so here is what I want to do :
- I have an ellipse, than I want to be displayed unfilled (whith a known line width)
- I have a full rectangle, and I want it to substracte itself from the ellipse.
- Then, I want to get the ellipse, unfilled, with a substracted part
So, here is my code :
// lGraphics and lBrush defined upper...
// Graphic paths
GraphicsPath lGraphicPathEllipse;
GraphicsPath lGraphicPathRectangle;
// Rectangles
Rect lRectEllipse(0, 0, 100, 100);
Rect lRectRectangle(10, -10, 100, 80);
// Add the shapes to the graphic pathes
lGraphicPathEllipse.AddEllipse(lRectEllipse);
lGraphicPathRectangle.AddRectangle(lRectRectangle);
// Create the regions
Region lRegionEllipse(&lGraphicPathEllipse);
Region lRegionRectangle(&lGraphicPathRectangle);
// Exclude the rectangle from the ellipse
lRegionEllipse.Exclude(&lRegionRectangle);
// Draw the ellipse region
lGraphics->FillRegion(&lBrush, &lRegionEllipse);
The problem is that what I get is actually this :
It seemes like creating a Region from a GraphicPath automatically fill the region. Is it possible to get a Region from a GraphicPath with only the outline? By giving a Pen or a line width for instance?
I've read thing about the GraphicPath Widen function, but it doesn't really do what I want.
It's strange to see that a simple thing like this can't be done.
Or maybe I have miss something!
Thanks for any help, and have a good day.
Alex.