简介
使用 Ellipse 控件绘制椭圆形和圆形。 若要绘制椭圆形,请创建 Ellipse 元素,并指定其 Width 和 Height。 使用其 Fill 属性指定用于绘制椭圆形内部的颜色。 使用其 Stroke 属性指定用于绘制椭圆形轮廓的颜色。 StrokeThickness 属性指定椭圆形轮廓的粗细。
属性
Width: 设置长度
Height: 设置宽度
Fill: 设置内部填充颜色
Storke: 设置边框颜色
StorkeThickness: 设置边框宽度
Demo
代码如下:
<Window x:Class="WPFDemo.Line.Views.EllipseWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        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"
        xmlns:local="clr-namespace:WPFDemo.Line.Views"
        mc:Ignorable="d"
        Title="EllipseWindow" Height="450" Width="800">
    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" >
        <Ellipse Width="200" Height="100" Fill="Orange" Stroke="Red" StrokeThickness="2">
        </Ellipse>
        <Ellipse Width="200" Height="200" Fill="Orange" Stroke="Red" StrokeThickness="2" Margin="50"></Ellipse>
    </StackPanel>
</Window>
 
效果如下:





现代C++的第三方库的导入方式: 例如Visual Studio 2022导入GSL 4.1.0](https://i-blog.csdnimg.cn/direct/c61ffae4304b4396bddaf6c49dfb4367.png)













