SimpleArc.axaml代码

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        Height="300" Width="300"
        x:Class="AvaloniaUI.SimpleArc"
        Title="SimpleArc">
    <Grid>
        <Path Stroke="Blue" StrokeThickness="3">
            <Path.Data>
                <PathGeometry>
                    <PathGeometry.Figures>
                        <PathFigure StartPoint="250,150" IsClosed="False">
                            <PathFigure.Segments>
                                <ArcSegment Point="10,100" Size="200,300" SweepDirection="Clockwise"/>
                            </PathFigure.Segments>
                        </PathFigure>
                    </PathGeometry.Figures>
                </PathGeometry>
            </Path.Data>
        </Path>
    </Grid>
</Window>

SimpleArc.axaml.cs代码

using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace AvaloniaUI;

public partial class SimpleArc : Window
{
    public SimpleArc()
    {
        InitializeComponent();
    }
}

运行效果

image

posted on 2025-09-06 13:52  dalgleish  阅读(11)  评论(0)    收藏  举报