Re: Draw and fill path using c# and NOT XAML

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks. I'll look into these.


"Peter Ritchie [C# MVP]" <PRSoCo@xxxxxxxxxxxxxxxxx> wrote in message
news:0EC5C945-6DA4-44FD-A37F-9A7953C95FFF@xxxxxxxxxxxxxxxx
If you're looking for complex shapes (i.e. not rectangle, bezier, pie, arc
etc.) then you may want to have a look at the Graphics class's Path
methods
like DrawPath, or FillPath [1]--which use the GraphicsPath class [2].
Depending on your requirements you might be able to use the Region methods
(like FillRegion [3]) instead.

[1]
http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.fillpath.aspx
[2]
http://msdn2.microsoft.com/en-us/library/system.drawing.drawing2d.graphicspath.aspx
[3]
http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.fillregion.aspx


--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#


"moondaddy" wrote:

I need to create some shapes using c# but all the examples I see are in
XAML.

For example how would I create this in c#?

<Path Data="M 20,60 C 60,20 100,60 150,60 " Stroke="Black"
StrokeThickness="4" Fill="yellow"/>


This isnt what I want to create, but its getting close to what I want.
I'm
attaching an image of what I want to create.

Thanks.



--
moondaddy@xxxxxxxxxxxxxxx





.