Click here to Skip to main content
15,883,623 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
The System.Windows.Shapes namespace (https://msdn.microsoft.com/en-us/library/system.windows.shapes%28v=vs.110%29.aspx[^] provides the classes of Ellipse, Rectangle, Line, Polygon, etc. I want to draw some shapes like Diamond, Triangle, Reversed Triangle. Can these shapes be obtained through the Polygon class? If yes, could you provide me a sample? Thanks.
Posted
Updated 1-Jun-15 10:52am
v2
Comments
[no name] 1-Jun-15 15:38pm    
Well since all of those shapes are polygons I would say yes.
http://stackoverflow.com/questions/3988105/draw-a-polygon-using-mouse-points-in-c-sharp

check the documentation of Graphics.FillPolygon Method[^].
follow the sample and you need to give the points for the shape you going to draw as parameter.
 
Share this answer
 
Yes, you can draw triangles using polygon. Since the URL in your question points to XAML, this link may help you with drawing triangles using XAML.

https://msdn.microsoft.com/en-us/library/ms745818(v=vs.110).aspx[^]

If you are looking for more, please refer this solved question here in codeproject.

How to draw a triangle in C#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900