Reputation: 11399
I think I once read that a pen can be set up in such a way that it draws "inside" a path, and not outside. I don't want my path to be enlarged. To be specific, I would like to paint a border around my path, and the border should not go outside the path.
This unfortunately enlarges my path:
Dim nPen As New Pen(Brushes.Black, 15)
g.DrawPath(nPen, nPath)
If anybody understands what I want to do, I would be glad to get a reply! Thank you very much.
Upvotes: 1
Views: 397
Reputation: 7517
You are looking for the Pen.Alignment property
. It can have following values (source):
You'll need the Inset
value.
Code example. You could use it like this:
Using nPen As New Pen(Brushes.Black, 15) With {.Alignment = Drawing2D.PenAlignment.Inset}
g.DrawPath(nPen, nPath)
End Using
(Note that I am using using
statement to ensure the object is being disposed.)
Upvotes: 1