gpt4 book ai didi

c# - 如何在 WPF XAML 中填充饼形区域

转载 作者:行者123 更新时间:2023-12-02 07:49:06 25 4
gpt4 key购买 nike

我有以下 XAML:

    <Ellipse StrokeThickness="2" Stroke="Green"></Ellipse>
<Rectangle Margin="150,0,149,150" Name="rectanglePie" Stroke="Green" Height="150" VerticalAlignment="Bottom">
<Rectangle.RenderTransform>
<RotateTransform x:Name="pieEdge" CenterX="0" CenterY="150" Angle="60" />
</Rectangle.RenderTransform>
</Rectangle>

<Rectangle Margin="150,0,149,150" Name="rectangleStatic" Stroke="Green" Height="150" VerticalAlignment="Bottom">
</Rectangle>

我想做的是用颜色填充其中包含的饼图。这可能吗?如果可以,我该怎么做?

最佳答案

让您开始...

<Canvas>
<Path Canvas.Left="150"
Canvas.Top="150"
Fill="Blue"
Stroke="Black">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="0 0"
IsClosed="True">
<LineSegment Point="200 110" />
<LineSegment Point="-100,100"/>
<ArcSegment x:Name="arc"
Size="100 100"
SweepDirection="ClockWise" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
</Canvas>

关于c# - 如何在 WPF XAML 中填充饼形区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26285076/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com