在 XAML / WPF 中创建重复符号

发布于 2024-09-12 09:12:34 字数 307 浏览 0 评论 0 原文

我需要在 XAML / WPF 中创建一个重复符号(程序代码也可以,但如果可能的话我更喜欢 XAML),如下所示,但我只需要带有箭头的未完成圆圈(白色绘图)按钮): http://www.vista-style-icons.com/libs/ phone/repeat.htm

我知道如何在 XAML 中创建一个圆圈,但我不知道如何创建一个未完成的圆圈并向开口端添加一个箭头? 感谢您的帮助!

I need to create a repeat symbol in XAML / WPF (procedural code would be ok too, though I'd prefer XAML if possible), something like the following, but I just need the not finished circle with the arrow (the white drawing in the button):
http://www.vista-style-icons.com/libs/phone/repeat.htm

I know how to create a circle in XAML, but I don't know how to create a not finished circle and add an arrow to the open end?
Thank you for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

毁梦 2024-09-19 09:12:34

您可以使用 ArcSegment 作为 路径 形状。您指定圆弧的起点和终点以及整个圆的半径。您可以通过将它们放在网格中将其呈现在蓝色圆圈的顶部:

<Grid Width="160" Height="160">
    <Ellipse Fill="Blue"/>
    <Path StrokeThickness="5" Stroke="White">
        <Path.Data>
            <PathGeometry>
                <PathFigure StartPoint="115,45">
                    <ArcSegment Point="115,115" Size="50,50" IsLargeArc="True"/>
                </PathFigure>
            </PathGeometry>
        </Path.Data>
    </Path>
    <Polygon Points="115,115 105,105 125,105 125,125" Fill="White"/>
</Grid>

您还可以使用较短的 路径标记语法创建 StreamGeometry 而不是 PathGeometry:

<Grid Width="160" Height="160">
    <Ellipse Fill="Blue"/>
    <Path Data="M 115,45 A 50,50 0 1 0 115,115"
        StrokeThickness="5" Stroke="White"/>
    <Polygon Points="115,115 105,105 125,105 125,125" Fill="White"/>
</Grid>

您需要对其进行修改才能获得您想要的外观,但这应该为您提供绘制未完成的圆的基本技术用箭头。

You can create an unfinished circle by using an ArcSegment as a path segment in a Path shape. You specify the start and end point of the arc and the radius of the entire circle. You can render it on top of a blue circle by putting them in a grid:

<Grid Width="160" Height="160">
    <Ellipse Fill="Blue"/>
    <Path StrokeThickness="5" Stroke="White">
        <Path.Data>
            <PathGeometry>
                <PathFigure StartPoint="115,45">
                    <ArcSegment Point="115,115" Size="50,50" IsLargeArc="True"/>
                </PathFigure>
            </PathGeometry>
        </Path.Data>
    </Path>
    <Polygon Points="115,115 105,105 125,105 125,125" Fill="White"/>
</Grid>

You can also use the shorter Path Markup Syntax to create a StreamGeometry rather than a PathGeometry:

<Grid Width="160" Height="160">
    <Ellipse Fill="Blue"/>
    <Path Data="M 115,45 A 50,50 0 1 0 115,115"
        StrokeThickness="5" Stroke="White"/>
    <Polygon Points="115,115 105,105 125,105 125,125" Fill="White"/>
</Grid>

You'll need to work on it to get exactly the look you want, but that should give you the basic technique for drawing an unfinished circle with an arrow.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文