Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

How to Draw a Border Around a Filled GraphicsPath

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charles Law - 21 Jun 2007 19:10 GMT
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
Bob Powell [MVP] - 27 Jun 2007 19:57 GMT
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.

Signature

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.

> Hi all
>
[quoted text clipped - 14 lines]
>
> Charles
Charles Law - 30 Jun 2007 09:15 GMT
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

> Have you visited the GDI+ FAQ?
>
[quoted text clipped - 24 lines]
>>
>> Charles

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.