WPF-利用Blend写的平面控制闸门开关动画

简介: 原文:WPF-利用Blend写的平面控制闸门开关动画 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yangyisen0713/article/details/18598665 Blend写的WPF控制闸门开关的动画,这个是平面效果,如果需要3D效果的话需要导入3D模型,然后在Blend中控制相机走位来控制闸门和水位的变化。
原文: WPF-利用Blend写的平面控制闸门开关动画

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yangyisen0713/article/details/18598665

Blend写的WPF控制闸门开关的动画,这个是平面效果,如果需要3D效果的话需要导入3D模型,然后在Blend中控制相机走位来控制闸门和水位的变化。

效果图:






xaml代码:

<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Class="wpf天狗食月动画.闸门控制"
	x:Name="Window"
	Title="闸门控制"
	Width="640" Height="480">
	<Window.Resources>
		<Storyboard x:Key="Storyboard1" AutoReverse="True" RepeatBehavior="Forever">
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="LayoutRoot">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFE8EBF0"/>
				<EasingColorKeyFrame KeyTime="0:0:3" Value="#FFE8EBF0"/>
			</ColorAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FF009DFF"/>
			</ColorAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.25"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.581"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="rectangle">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.921"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-3.398"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="56.071"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle1">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-20.389"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle1">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="50.974"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle1_Copy">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="258.266"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle1_Copy">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="51.823"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle1">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFBBBBC2"/>
			</ColorAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle1_Copy">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFBBBBC2"/>
			</ColorAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle2">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-20.389"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle2_Copy">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="181.805"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle2_Copy">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="51.823"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle3">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle3">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-22.088"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle3">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="50.974"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle3">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFBBBBC2"/>
			</ColorAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle2">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFBBBBC2"/>
			</ColorAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle2_Copy">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFBBBBC2"/>
			</ColorAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle2">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="50.124"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle4">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFBBBBC2"/>
				<EasingColorKeyFrame KeyTime="0:0:3" Value="#FFBBBBC2"/>
			</ColorAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle4">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.76"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="0.76"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle4">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="2.551"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="2.551"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle5">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFB16213"/>
				<EasingColorKeyFrame KeyTime="0:0:3" Value="#FFB16213"/>
			</ColorAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="path">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="23.788"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="path">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.851"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="path1">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.85"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="path1">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="47.575"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="path2">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="81.558"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="path2">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="2.549"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="path3">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="112.991"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="path3">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.85"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="path4">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-37.387"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="path4">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.85"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="path5">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.85"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="path5">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-3.4"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle4">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-0.85"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="-81.6"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="-4.25"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle6">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="2.549"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="2.549"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle6">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.85"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="-79.9"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="-2.55"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Rectangle.RadiusX)" Storyboard.TargetName="rectangle6">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="19.889"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="19.889"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Rectangle.RadiusY)" Storyboard.TargetName="rectangle6">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="19.889"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="19.889"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle6">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFB1B1B4"/>
				<EasingColorKeyFrame KeyTime="0:0:3" Value="#FFB1B1B4"/>
			</ColorAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Rectangle.RadiusX)" Storyboard.TargetName="rectangle7">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Rectangle.RadiusY)" Storyboard.TargetName="rectangle7">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="rectangle7">
				<EasingColorKeyFrame KeyTime="0:0:2" Value="#FFB1B1B4"/>
			</ColorAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="rectangle7">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="157.168"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle7">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="22.938"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="-57.812"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="19.538"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle7">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.946"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="rectangle7">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.556"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="rectangle5">
				<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:3" Value="-80.75"/>
				<EasingDoubleKeyFrame KeyTime="0:0:5" Value="-3.4"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</Window.Resources>
	<Window.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
		</EventTrigger>
	</Window.Triggers>

	<Grid x:Name="LayoutRoot" Background="#FF009DFF">
		<Rectangle x:Name="rectangle" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="150.371" Margin="138.726,218.673,0,0" Stroke="Black" VerticalAlignment="Top" Width="352.566" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Rectangle x:Name="rectangle1" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="182.655" Margin="154.018,185.54,0,0" Stroke="Black" VerticalAlignment="Top" Width="53.522" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Rectangle x:Name="rectangle1_Copy" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="182.655" Margin="154.018,185.54,0,0" Stroke="Black" VerticalAlignment="Top" Width="53.522" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Rectangle x:Name="rectangle2" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="321.133" Margin="205.841,47.062,0,0" Stroke="Black" VerticalAlignment="Top" Width="24.637" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Rectangle x:Name="rectangle2_Copy" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="321.133" Margin="205.841,47.062,0,0" Stroke="Black" VerticalAlignment="Top" Width="24.637" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Rectangle x:Name="rectangle3" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="12.744" Margin="207.54,35.168,0,0" Stroke="Black" VerticalAlignment="Top" Width="226.832" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Rectangle x:Name="rectangle4" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="193.699" Margin="284,18.177,0,0" Stroke="Black" VerticalAlignment="Top" Width="21.239" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Rectangle x:Name="rectangle5" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="212.389" Margin="210.088,208.478,0,0" Stroke="Black" VerticalAlignment="Top" Width="177.558" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Path x:Name="path5" Data="M0.5,0.5 L176.35791,0.5" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="1.5" Margin="209.589,274.243,0,0" Stroke="Black" VerticalAlignment="Top" Width="176.858" RenderTransformOrigin="0.5,0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path x:Name="path" Data="M0.5,0.5 L176.35791,0.5" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="1.5" Margin="209.589,274.243,0,0" Stroke="Black" VerticalAlignment="Top" Width="176.858" RenderTransformOrigin="0.5,0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path x:Name="path1" Data="M0.5,0.5 L176.35791,0.5" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="1.5" Margin="209.589,274.243,0,0" Stroke="Black" VerticalAlignment="Top" Width="176.858" RenderTransformOrigin="0.5,0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path x:Name="path2" Data="M0.5,0.5 L176.35791,0.5" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="1.5" Margin="209.589,274.243,0,0" Stroke="Black" VerticalAlignment="Top" Width="176.858" RenderTransformOrigin="0.5,0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path x:Name="path3" Data="M0.5,0.5 L176.35791,0.5" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="1.5" Margin="209.589,274.243,0,0" Stroke="Black" VerticalAlignment="Top" Width="176.858" RenderTransformOrigin="0.5,0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Path x:Name="path4" Data="M0.5,0.5 L176.35791,0.5" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="1.5" Margin="209.589,274.243,0,0" Stroke="Black" VerticalAlignment="Top" Width="176.858" RenderTransformOrigin="0.5,0.5">
			<Path.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Path.RenderTransform>
		</Path>
		<Rectangle x:Name="rectangle6" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="16.142" Margin="270.407,38.566,0,0" Stroke="Black" VerticalAlignment="Top" Width="48.425" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
		<Rectangle x:Name="rectangle7" Fill="#FF0C0C0D" HorizontalAlignment="Left" Height="15.292" Margin="124.283,29.221,0,0" Stroke="Black" VerticalAlignment="Top" Width="31.434" RenderTransformOrigin="0.5,0.5">
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
	</Grid>
</Window>


目录
相关文章
WPF中动画教程(DoubleAnimation的基本使用)
WPF中动画教程(DoubleAnimation的基本使用)
248 0
|
算法 C# Windows
不可不知的WPF动画(Animation)
【9月更文挑战第19天】在 WPF(Windows Presentation Foundation)中,动画能为应用程序增添生动性和交互性。主要类型包括线性动画和关键帧动画,可针对依赖属性和自定义属性操作。触发方式有事件触发和自动触发,支持暂停、恢复及停止控制。合理使用这些功能并注意性能优化,可创建引人入胜的用户界面。
281 7
|
C# UED 开发者
WPF与性能优化:掌握这些核心技巧,让你的应用从卡顿到丝滑,彻底告别延迟,实现响应速度质的飞跃——从布局到动画全面剖析与实例演示
【8月更文挑战第31天】本文通过对比优化前后的方法,详细探讨了提升WPF应用响应速度的策略。文章首先分析了常见的性能瓶颈,如复杂的XAML布局、耗时的事件处理、不当的数据绑定及繁重的动画效果。接着,通过具体示例展示了如何简化XAML结构、使用后台线程处理事件、调整数据绑定设置以及利用DirectX优化动画,从而有效提升应用性能。通过这些优化措施,WPF应用将更加流畅,用户体验也将得到显著改善。
1535 1
|
C# UED 开发者
WPF动画大揭秘:掌握动画技巧,让你的界面动起来,告别枯燥与乏味!
【8月更文挑战第31天】在WPF应用开发中,动画能显著提升用户体验,使其更加生动有趣。本文将介绍WPF动画的基础知识和实现方法,包括平移、缩放、旋转等常见类型,并通过示例代码展示如何使用`DoubleAnimation`创建平移动画。此外,还将介绍动画触发器的使用,帮助开发者更好地控制动画效果,提升应用的吸引力。
770 0
|
存储 C# 数据格式
WPF动画教程(PointAnimationUsingPath的使用)
WPF动画教程(PointAnimationUsingPath的使用)
196 0
|
C#
WPF —— 动画缩放变换
`ScaleTransform`用于二维x-y坐标系中对象的缩放,可沿X或Y轴调整。在故事板中,通过RenderTransform.ScaleX和ScaleY属性控制缩放。示例代码展示了如何设置按钮的RenderTransformOrigin、Background等属性,并通过LayoutTransform应用ScaleTransform。当鼠标进入按钮时,EventTrigger启动DoubleAnimation实现X和Y轴的缩放动画。最后,展示了如何将动画集成到自定义按钮样式中。
382 0
|
C#
WPF技术之动画系列-上下运动
本例子展现动画小球上下循环运动
393 0
|
API C# 索引
WPF中的动画——(一)基本概念
原文:WPF中的动画——(一)基本概念 WPF的一个特点就是支持动画,我们可以非常容易的实现漂亮大方的界面。首先,我们来复习一下动画的基本概念。计算机中的动画一般是定格动画,也称之为逐帧动画,它通过每帧不同的图像连续播放,从而欺骗眼和脑产生动画效果。
1249 0
|
C# 测试技术
WPF中的动画——(二)From/To/By 动画
原文:WPF中的动画——(二)From/To/By 动画 我们所实现的的动画中,很大一部分是让一个属性在起始值和结束值之间变化,例如,我在前文中实现的改变宽度的动画:     var widthAnimation = new DoubleAnimation()    {        From = 0,        To = 320,        Duration = TimeSpan.
1115 0
|
算法 C#
WPF中的动画——(五)关键帧动画
原文:WPF中的动画——(五)关键帧动画 与 From/To/By 动画类似,关键帧动画以也可以以动画形式显示目标属性值。 和From/To/By 动画不同的是, From/To/By 动画只能控制在两个状态之间变化,而关键帧动画则可以在多个状态之间变化,例如,对于前面那个改变按钮宽度的例子,如果我们要实现如下效果: 在2秒时将宽度从 0变为350 在7秒时将宽度变为50 在9秒的时候将其宽度变为200 虽然我们可以用三个From/To/By 动画组合实现类似效果,但是这样一来麻烦,二来要感知动画完成事件,不方便在XAML中使用。
1654 0