views:

50

answers:

1

I am creating a rounded rectangle GraphicsPath (see red outline image below), and then using this as a clip region both when drawing graphics, and as the Region of a Form.

Unfortunately, although the path looks good, it doesn't work well as a region (see solid black image below)

Is there a way that I can generate a clipping region from the path that includes all the 'outline' pixels of the path? Do I need to generate a bitmap and then process this to create a region?

The rounded rectangle path:

rounded rectangle

When used as a clip region:

clip region

The discrepancy (red pixels are in the path outline, but outside the region. blue pixels are in both):

overlap

A: 

I ended up drawing the shape into a bitmap and then converting this into a region.

Here is an example of this.

mackenir