views:

32

answers:

1

Hi all,

I have created a custom control inheriting from a panel in .NET 3.5

The panel has a custom polygon border, which comes from a pointF array (In diagram, control is highlighted yellow).

Fig 1 shows the control with BorderStyle none. Fig 2 with BorderStyle fixed-single

As shown in Fig 2, the border follows the Rectangle bounding the control. IS there a way to make the border follow the actual border of the control set by the polygon?

FYI the polygon is created using a GraphicsPath object.

Drawing the line with GDI+ does not work, as the control clips the line and it looks awful...

alt text

Fig1


alt text

Fig2

+1  A: 

I would do a transform on the points (zoom-in), then use Graphics.DrawPolygon(brush, points) using the transformed points, or you could do the inverse (fill in with black, then transform (zoom-in) and then draw again smaller with yellow.

eschneider