如何绘制三角形或菱形? [英] How to draw a triangle or diamond shape?

查看:110
本文介绍了如何绘制三角形或菱形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.Windows.Shapes命名空间( https ://msdn.microsoft.com/en-us/library/system.windows.shapes%28v=vs.110%29.aspx [ ^ ]提供Ellipse,Rectangle,Line,我希望绘制一些形状,如钻石,三角形,反转三角形。这些形状可以通过Polygon类获得吗?如果是,你可以给我一个样品吗?谢谢。

解决方案

查看 Graphics.FillPolygon方法的文档 [ ^ ]。

跟随样本,您需要给出要绘制的形状的点作为参数r。


是的,您可以使用多边形绘制三角形。由于您的问题中的网址指向XAML,因此此链接可以帮助您使用XAML绘制三角形。



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



如果您正在寻找更多信息,请在codeproject中查看此解决的问题。



< a href =http://www.codeproject.com/Questions/585090/HowplustoplusdrawplusaplustriangleplusinplusC>如何在C#中绘制三角形 [








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.

解决方案

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.


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#[^]


这篇关于如何绘制三角形或菱形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆