How to Draw a Border Around a Filled GraphicsPath

  • Thread starter Thread starter Charles Law
  • Start date Start date
C

Charles Law

Hi all

I have a user control that I draw onto using a GraphicsPath. The GP is
non-rectangular. I get a region from the GP and assign it to the control's
region. I then want to put a border round the region. Can anyone tell me how
to do this?

The purpose of the exercise is to create several controls, each of different
shapes, and drag-and-drop them onto a form. They will then be positioned
with the mouse to form a pattern. I seem to be able to fill the shape, but
not put a border round it.

Any help is appreciated. I have Googled extensively but all I can find is
other people trying to do a similar thing without an answer.

TIA

Charles
 
Have you visited the GDI+ FAQ?

Extensive googling should at least turn that up.

Try also going to the beginners guide to GDI+ which contains loads of
info for beginners.

Use FillPath and DrawPath with the appropriate brush and pen to do theae
operations.


--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Beginner? Moi? ;-)

Hi Bob
Use FillPath and DrawPath with the appropriate brush and pen to do theae
operations.

This works fine on its own.

The problem occurs when I use my GraphicsPath to create a region and assign
it to the region of the user control. I get a filled region, as desired, but
DrawPath does not put a border around it.

Charles
 
Back
Top