Groups | Blog | Home
all groups > dotnet drawing api > february 2006 >

dotnet drawing api : FillPath question


Steve Marshall
2/23/2006 8:52:15 PM
Hi All,

I'm using Graphics.FillPath to clear the area under a plotted curve. It
works fine, but the fill operation seems to "eat away" some of the thickness
of the plotted line - maybe one pixel. Has anyone else observed this? Is
there a way to stop it happening?

Thanks

Bob Powell [MVP]
2/25/2006 5:01:39 PM
The fill covers the area _inside_ the path.
Fill and then stroke the path with a pen using the same brush as you used to
fill the path.

--
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.





[quoted text, click to view]

Steve Marshall
2/26/2006 12:00:00 AM
Thanks Bob,

Now that this has floated around in the back of my tiny brain for a few
days, I can sort of visualise what is happening - if my original plot line
is (say) 3 pixels wide, the FillPath will fill to the "centre" of the line,
which will sometimes fill over half the width of the line. So you are quite
right - I need to do the fill first, then plot the line. It doesn't need
the line there to be able to fill the path. Makes perfect sense once the
penny drops!

--
Remove numeral in e-mail address to send e-mails.
www.marshallarts.com.au
[quoted text, click to view]

AddThis Social Bookmark Button