加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

wpf – 如何在XAML中绘制单独的圆圈?

发布时间:2020-12-14 05:37:55 所属栏目:Windows 来源:网络整理
导读:我怎样才能画出这样的圆圈,2个颜色分为2个部分.我在xaml编码 Ellipse Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" Height="300" /Ellipse Path VerticalAlignment="Top" Fill="Brown" HorizontalAlignment="Left" Pa
我怎样才能画出这样的圆圈,2个颜色分为2个部分.我在xaml编码

<Ellipse Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" Height="300">

                    </Ellipse>

                    <Path VerticalAlignment="Top" Fill="Brown" HorizontalAlignment="Left">
                        <Path.Data>
                            <PathGeometry>
                                <PathFigure StartPoint="59,150">
                                    <ArcSegment SweepDirection="Clockwise" Size="141,80" Point="341,150"/>
                                </PathFigure>
                            </PathGeometry>
                        </Path.Data>
                    </Path>

我试试了,上面的路径还没有完整的部分1.帮我试试吧!

解决方法

您还可以使用以下内容……

<Grid Height="200" Width="200" VerticalAlignment="Center">
        <Ellipse Fill="#FFE1B631"  />
        <Path Data="M93.88768,0 C136.17198,0 172.32661,26.244247 186.95134,63.33252 L187.77536,65.5 0,65.5 0.82401276,63.33252 C15.44875,26.244247 51.603378,0 93.88768,0 z" Fill="#FFFD450F" Height="60.26" Stretch="Fill" VerticalAlignment="Top" Margin="8,1.31,8,0"/> 
    </Grid>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读