feat: 13-几何图形和图画-3使用CombinedGeometry
This commit is contained in:
parent
52c0bfddaa
commit
069c6f6bf1
|
@ -0,0 +1,19 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<RootNamespace>_13_几何图形和图画_3使用CombinedGeometry</RootNamespace>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="public\003540AH4M72.jpg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="public\bunny.png"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,9 @@
|
|||
<Application x:Class="_13_几何图形和图画_3使用CombinedGeometry.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:_13_几何图形和图画_3使用CombinedGeometry"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
|
@ -0,0 +1,12 @@
|
|||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Windows;
|
||||
|
||||
namespace _13_几何图形和图画_3使用CombinedGeometry;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
|
@ -0,0 +1,95 @@
|
|||
<Window x:Class="_13_几何图形和图画_3使用CombinedGeometry.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-几何图形和图画-3使用CombinedGeometry" Height="800" Width="800">
|
||||
<StackPanel>
|
||||
<Label>融合图形-合并</Label>
|
||||
<Path Fill="Yellow" Stroke="Blue" Margin="5">
|
||||
<Path.Data>
|
||||
<CombinedGeometry GeometryCombineMode="Union">
|
||||
<CombinedGeometry.Geometry1>
|
||||
<RectangleGeometry Rect="0,0 100,100" />
|
||||
</CombinedGeometry.Geometry1>
|
||||
|
||||
<CombinedGeometry.Geometry2>
|
||||
<EllipseGeometry Center="85,50" RadiusX="65" RadiusY="35" />
|
||||
</CombinedGeometry.Geometry2>
|
||||
</CombinedGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
|
||||
<Label>融合图形-交集</Label>
|
||||
<Path Fill="BlueViolet" Stroke="Blue" Margin="5">
|
||||
<Path.Data>
|
||||
<CombinedGeometry GeometryCombineMode="Intersect">
|
||||
<CombinedGeometry.Geometry1>
|
||||
<RectangleGeometry Rect="0,0 100,100" />
|
||||
</CombinedGeometry.Geometry1>
|
||||
|
||||
<CombinedGeometry.Geometry2>
|
||||
<EllipseGeometry Center="85,50" RadiusX="65" RadiusY="35" />
|
||||
</CombinedGeometry.Geometry2>
|
||||
</CombinedGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
|
||||
<Label>融合图形-不包含</Label>
|
||||
<Path Fill="CadetBlue" Stroke="Blue" Margin="5">
|
||||
<Path.Data>
|
||||
<CombinedGeometry GeometryCombineMode="Exclude">
|
||||
<CombinedGeometry.Geometry1>
|
||||
<RectangleGeometry Rect="0,0 100,100" />
|
||||
</CombinedGeometry.Geometry1>
|
||||
<CombinedGeometry.Geometry2>
|
||||
<EllipseGeometry Center="85,50" RadiusX="65" RadiusY="35" />
|
||||
</CombinedGeometry.Geometry2>
|
||||
</CombinedGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
|
||||
<Label>融合图形-不包含</Label>
|
||||
<Path Fill="DeepSkyBlue" Stroke="Blue" Margin="5">
|
||||
<Path.Data>
|
||||
<CombinedGeometry GeometryCombineMode="Xor">
|
||||
<CombinedGeometry.Geometry1>
|
||||
<RectangleGeometry Rect="0,0 100,100" />
|
||||
</CombinedGeometry.Geometry1>
|
||||
<CombinedGeometry.Geometry2>
|
||||
<EllipseGeometry Center="85,50" RadiusX="65" RadiusY="35" />
|
||||
</CombinedGeometry.Geometry2>
|
||||
</CombinedGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
|
||||
<Label>旋转</Label>
|
||||
<Path Fill="RoyalBlue" Stroke="Blue" Margin="5">
|
||||
<Path.Data>
|
||||
<CombinedGeometry GeometryCombineMode="Union">
|
||||
<CombinedGeometry.Geometry1>
|
||||
<CombinedGeometry GeometryCombineMode="Exclude">
|
||||
<CombinedGeometry.Geometry1>
|
||||
<EllipseGeometry Center="50,50" RadiusX="50" RadiusY="50" />
|
||||
</CombinedGeometry.Geometry1>
|
||||
|
||||
<CombinedGeometry.Geometry2>
|
||||
<EllipseGeometry Center="50,50" RadiusX="40" RadiusY="40" />
|
||||
</CombinedGeometry.Geometry2>
|
||||
</CombinedGeometry>
|
||||
</CombinedGeometry.Geometry1>
|
||||
|
||||
<CombinedGeometry.Geometry2>
|
||||
<RectangleGeometry Rect="44,5 10,90">
|
||||
<RectangleGeometry.Transform>
|
||||
<RotateTransform Angle="45" CenterX="50" CenterY="50" />
|
||||
</RectangleGeometry.Transform>
|
||||
</RectangleGeometry>
|
||||
</CombinedGeometry.Geometry2>
|
||||
</CombinedGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
|
||||
</StackPanel>
|
||||
</Window>
|
|
@ -0,0 +1,23 @@
|
|||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace _13_几何图形和图画_3使用CombinedGeometry;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 97 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
|
@ -52,6 +52,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "13-几何图形和图画-1
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "13-几何图形和图画-2使用GeometryGroup组合形状", "13-几何图形和图画-2使用GeometryGroup组合形状\13-几何图形和图画-2使用GeometryGroup组合形状.csproj", "{23BCED14-3B5E-43FE-A173-9A638A57F816}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "13-几何图形和图画-3使用CombinedGeometry", "13-几何图形和图画-3使用CombinedGeometry\13-几何图形和图画-3使用CombinedGeometry.csproj", "{7E79F58B-CFB3-41BF-A692-6E83F88881EE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -162,5 +164,9 @@ Global
|
|||
{23BCED14-3B5E-43FE-A173-9A638A57F816}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{23BCED14-3B5E-43FE-A173-9A638A57F816}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{23BCED14-3B5E-43FE-A173-9A638A57F816}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7E79F58B-CFB3-41BF-A692-6E83F88881EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7E79F58B-CFB3-41BF-A692-6E83F88881EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7E79F58B-CFB3-41BF-A692-6E83F88881EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7E79F58B-CFB3-41BF-A692-6E83F88881EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
Loading…
Reference in New Issue