feat: 12-形状画刷和变换-2改变形状的尺寸和放置形状-1

This commit is contained in:
Bunny 2025-01-15 17:45:06 +08:00
parent 6f4d7ae266
commit de3d189877
9 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<RootNamespace>_12_形状画刷和变换_2改变形状的尺寸和放置形状_1</RootNamespace>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<Resource Include="public\003540AH4M72.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
</Project>

View File

@ -0,0 +1,9 @@
<Application x:Class="_12_形状画刷和变换_2改变形状的尺寸和放置形状_1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:_12_形状画刷和变换_2改变形状的尺寸和放置形状_1"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View File

@ -0,0 +1,12 @@
using System.Configuration;
using System.Data;
using System.Windows;
namespace _12_形状画刷和变换_2改变形状的尺寸和放置形状_1;
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}

View File

@ -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)
)]

View File

@ -0,0 +1,13 @@
<Window x:Class="_12_形状画刷和变换_2改变形状的尺寸和放置形状_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="_12_形状画刷和变换_2改变形状的尺寸和放置形状_1" Height="450" Width="800">
<Canvas>
<Label>使用Canvas注意先后关系</Label>
<Ellipse Fill="Yellow" Stroke="Blue" Canvas.Left="100" Canvas.Top="50" Width="100" Height="50" />
<Rectangle Fill="Yellow" Stroke="Blue" Canvas.Left="30" Canvas.Top="40" Width="100" Height="50" />
</Canvas>
</Window>

View File

@ -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 _12_形状画刷和变换_2改变形状的尺寸和放置形状_1;
/// <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

View File

@ -14,6 +14,7 @@
</Grid.RowDefinitions>
<Ellipse Grid.Row="0" Fill="Peru" Stroke="Black" Stretch="Fill" />
<!-- Stretch="None" 除非将高宽设置为非0否则不会显示 -->
<Ellipse Grid.Row="1" Fill="Green" Stroke="Blue" Stretch="None" />
<Ellipse Grid.Row="2" Fill="Yellow" Stroke="Blue" Stretch="Uniform" />
<Ellipse Grid.Row="3" Fill="Red" Stroke="Blue" Stretch="UniformToFill" />

View File

@ -6,6 +6,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "12-形状画刷和变换-1
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "12-形状画刷和变换-2改变形状的尺寸和放置形状", "12-形状画刷和变换-2改变形状的尺寸和放置形状\12-形状画刷和变换-2改变形状的尺寸和放置形状.csproj", "{1B71F450-5321-4736-B534-97A19851A06C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "12-形状画刷和变换-2改变形状的尺寸和放置形状-1", "12-形状画刷和变换-2改变形状的尺寸和放置形状-1\12-形状画刷和变换-2改变形状的尺寸和放置形状-1.csproj", "{7D48D1E3-E323-48ED-A086-776A64B7AD38}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -24,5 +26,9 @@ Global
{1B71F450-5321-4736-B534-97A19851A06C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B71F450-5321-4736-B534-97A19851A06C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B71F450-5321-4736-B534-97A19851A06C}.Release|Any CPU.Build.0 = Release|Any CPU
{7D48D1E3-E323-48ED-A086-776A64B7AD38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D48D1E3-E323-48ED-A086-776A64B7AD38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D48D1E3-E323-48ED-A086-776A64B7AD38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D48D1E3-E323-48ED-A086-776A64B7AD38}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal