[英]Draw a semicircle / half circle in WPF / C#
我需要在WPF中绘制一个半圆/半圆。 知道怎么做吗? 谢谢你的提示!
ArcSegment
将是一个很好的起点。
这是一个如何在代码中使用它的一个很好的例子。
由于原始链接已死,以下是我能够绘制弧线的方法:
<Canvas>
<Path Stroke="Gray">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure StartPoint="0,20">
<PathFigure.Segments>
<PathSegmentCollection>
<ArcSegment Size="20, 20"
IsLargeArc="True"
SweepDirection="CounterClockwise"
Point="40,20" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
</Canvas>
这会产生以下图像(为某些变量添加了标记)
上面的XAML是此处的XAML的修改版本:
https://www.c-sharpcorner.com/UploadFile/mahesh/drawing-arc-using-arcsegment-in-xaml/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.