4-Graphics_Animation/13-几何图形和图画-1路径和集合图形/MainWindow.xaml

41 lines
1.7 KiB
XML

<Window x:Class="_13_几何图形和图画_1路径和集合图形.MainWindow"
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"
mc:Ignorable="d"
Icon="public/003540AH4M72.jpg" Title="13-几何图形和图画-1路径和集合图形" Height="450" Width="800">
<ScrollViewer>
<StackPanel Margin="10">
<Label>直接使用图形绘制</Label>
<Rectangle Fill="Red" Stroke="Blue" Width="100" Height="50" />
<Label>图形,使用路径绘制</Label>
<Path Fill="Yellow" Stroke="Blue">
<Path.Data>
<RectangleGeometry Rect="0,0 100,50" />
</Path.Data>
</Path>
<Label>绘制直线</Label>
<Line Stroke="Blue" X1="0" Y1="0" X2="10" Y2="100" />
<Label>转变成LineGeometry</Label>
<Path Fill="Yellow" Stroke="Blue">
<Path.Data>
<LineGeometry StartPoint="0,0" EndPoint="10,100" />
</Path.Data>
</Path>
<Label>也可以将如下Ellipse形状</Label>
<Ellipse Fill="Yellow" Stroke="Blue" Width="100" Height="50" HorizontalAlignment="Left" />
<Label>转成EllipseGeometry</Label>
<Path Fill="Yellow" Stroke="Blue">
<Path.Data>
<EllipseGeometry RadiusX="50" RadiusY="25" Center="50,25" />
</Path.Data>
</Path>
</StackPanel>
</ScrollViewer>
</Window>