如何用连续的曲线边界线绘制Reactangle [英] How to draw Reactangle with continuos curved border line
问题描述
需要绘制带有弯曲的多个边框的Reactangle.请建议
Need to Draw Reactangle with curved multiple border.Kindly suggest
推荐答案
Jagadish12345,
Hi Jagadish12345,
根据您的描述,您想要绘制带有连续弯曲边界线的Reactangle.据我所知,在WPF中,合适的方法是使用Path
From your description, you want draw Reactangle with continuos curved border line. In WPF, As far as I know, the suitable way to do this is using Path
以下代码供您参考.您需要更改LineSegment点的值以绘制所需的形状.
The following code for your reference. You need to change the LineSegment Point value to draw the shape you want.
<Canvas>
<Path Stroke="Black" StrokeThickness="1" Fill="White">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="100,50" IsClosed="True">
<LineSegment Point="140,60"/>
<LineSegment Point="150,100"/>
<LineSegment Point="160,120"/>
<LineSegment Point="120,80"/>
<LineSegment Point="115,100"/>
<LineSegment Point="90,110"/>
<LineSegment Point="80,80"/>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
</Canvas>
以下链接供您参考.
如何:在PathGeometry中创建LineSegment:
https://docs.microsoft.com/zh-CN/dotnet/framework/wpf/graphics-multimedia/how-to-to-create-a-linesegment-in-a-pathgeometry
How to: Create a LineSegment in a PathGeometry:
https://docs.microsoft.com/en-us/dotnet/framework/wpf/graphics-multimedia/how-to-create-a-linesegment-in-a-pathgeometry
PathGeometry类别:
https://msdn.microsoft.com/zh-CN/library/system.windows.media.pathgeometry%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
PathGeometry Class:
https://msdn.microsoft.com/en-us/library/system.windows.media.pathgeometry%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
最好的问候,
Best Regards,
吕汉楠
这篇关于如何用连续的曲线边界线绘制Reactangle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!