实例介绍
【实例简介】
注意:该实例不含任何业务逻辑,无点击事件效果,仅仅是wpf图片效果展示
【实例截图】
【核心代码】
<Window 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:Anno="http://schemas.microsoft.com/expression/blend/extensions/annotations/2008" mc:Ignorable="d Anno" x:Class="WpfApplication71.MainWindow" x:Name="Window" Title="MainWindow" Width="900" Height="630" WindowStyle="None" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" AllowsTransparency="True" Background="{x:Null}" Foreground="{x:Null}" Topmost="True"> <Window.Resources> <Storyboard x:Key="Storyboard1"> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="wind"> <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse"> <EasingDoubleKeyFrame KeyTime="0" Value="0"/> <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.5"/> <EasingDoubleKeyFrame KeyTime="0:0:1.7" Value="0"/> <EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle"> <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.7"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle1"> <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.7"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="grid"> <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/> <EasingDoubleKeyFrame KeyTime="0:0:2" Value="402"> <EasingDoubleKeyFrame.EasingFunction> <CubicEase EasingMode="EaseOut"/> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="grid1"> <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/> <EasingDoubleKeyFrame KeyTime="0:0:2" Value="-440"> <EasingDoubleKeyFrame.EasingFunction> <CubicEase EasingMode="EaseOut"/> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ellipse"> <DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Visible}"/> <DiscreteObjectKeyFrame KeyTime="0:0:2" Value="{x:Static Visibility.Hidden}"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="after_Copy"> <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/> </EventTrigger> </Window.Triggers> <Grid x:Name="LayoutRoot" Margin="0"> <Grid x:Name="grid" Margin="-8.377,231.5,-12.377,-2.5" RenderTransformOrigin="0.5,0.5"> <Grid.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </Grid.RenderTransform> <Path Data="M0,432 L0,631.5 903.5,631.5 903.5,231.5" Fill="Black" Margin="6.877,-1.833,9.377,1.833" Stretch="Fill" Stroke="Black"> <Anno:AnnotationManager.Annotations> <Anno:Annotation AuthorInitials="孙志明" Author="孙志明" Left="820" SerialNumber="1" Top="288" Timestamp="06/06/2014 03:06:40" Text="可以在开过程中蹦出球体、阳光等特效,如参考图效果。"/> </Anno:AnnotationManager.Annotations> </Path> <Rectangle x:Name="rectangle" Height="6.438" Margin="0,99.947,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Opacity="0.2"> <Rectangle.Fill> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <LinearGradientBrush.RelativeTransform> <TransformGroup> <ScaleTransform CenterY="0.5" CenterX="0.5"/> <SkewTransform CenterY="0.5" CenterX="0.5"/> <RotateTransform CenterY="0.5" CenterX="0.5" Angle="90"/> <TranslateTransform/> </TransformGroup> </LinearGradientBrush.RelativeTransform> <GradientStop Color="Black"/> <GradientStop Color="Black" Offset="1"/> <GradientStop Color="#FFBABABA" Offset="0.517"/> </LinearGradientBrush> </Rectangle.Fill> <Rectangle.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform Angle="-12.499"/> <TranslateTransform/> </TransformGroup> </Rectangle.RenderTransform> </Rectangle> </Grid> <Grid x:Name="grid1" Margin="-8.377,-1.167,-12.377,198.167" RenderTransformOrigin="0.5,0.5"> <Grid.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </Grid.RenderTransform> <Path Data="M0,0 L0,431.5 903.5,231.5 903.5,-0.5" Fill="Black" Stretch="Fill" Stroke="Black" Margin="7.043,-0.25,9.211,0.25"/> <Rectangle x:Name="rectangle1" Margin="-0.333,0,0.333,101.448" RenderTransformOrigin="0.5,0.5" Height="6.438" VerticalAlignment="Bottom" Opacity="0.2"> <Rectangle.Fill> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <LinearGradientBrush.RelativeTransform> <TransformGroup> <ScaleTransform CenterY="0.5" CenterX="0.5"/> <SkewTransform CenterY="0.5" CenterX="0.5"/> <RotateTransform CenterY="0.5" CenterX="0.5" Angle="90"/> <TranslateTransform/> </TransformGroup> </LinearGradientBrush.RelativeTransform> <GradientStop Color="Black"/> <GradientStop Color="Black" Offset="1"/> <GradientStop Color="#FFC4C4C4" Offset="0.517"/> </LinearGradientBrush> </Rectangle.Fill> <Rectangle.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform Angle="-12.499"/> <TranslateTransform/> </TransformGroup> </Rectangle.RenderTransform> </Rectangle> </Grid> <Ellipse x:Name="ellipse" Margin="168.638,118.004,97.359,92.095" RenderTransformOrigin="0.5,0.5" Opacity="0"> <Ellipse.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform Angle="-12.041"/> <TranslateTransform/> </TransformGroup> </Ellipse.RenderTransform> <Ellipse.Fill> <RadialGradientBrush> <GradientStop Offset="1"/> <GradientStop Color="White"/> <GradientStop Color="#66FFFFFF" Offset="0.5"/> </RadialGradientBrush> </Ellipse.Fill> </Ellipse> <Grid x:Name="wind" Margin="269.5,200.5,293.5,192.5"> <Grid.RowDefinitions> <RowDefinition Height="80"/> <RowDefinition/> <RowDefinition Height="auto" MinHeight="60.814"/> </Grid.RowDefinitions> <Button x:Name="quite" Content="关闭" Width="40" Height="30.28" Cursor="Hand" Background="White" BorderBrush="#FF9B9B9B" Opacity="0.5" Click="quite_Click" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-184.5,-281.5,0"/> <TextBlock x:Name="textBlock" Text="用户登录" FontSize="36" FontFamily="YouYuan" VerticalAlignment="Center" Foreground="#FFD44015" Margin="90,0" HorizontalAlignment="Center"/> <Grid Margin="30,8,47,0" Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="auto" /> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="auto" MinHeight="62.813"/> </Grid.RowDefinitions> <TextBlock x:Name="textBlock1" Grid.Column="0" Grid.Row="0" Text="用户名:" FontSize="16" VerticalAlignment="Center" FontFamily="YouYuan" Foreground="White" Margin="-0.334,0,0.334,0"/> <TextBox x:Name="textBox" Grid.Column="1" Grid.Row="0" Margin="3,4,0,4" FontSize="24" Opacity="0.9" Height="34"/> <TextBlock x:Name="textBlock2" Grid.Column="0" Grid.Row="1" Text="密码:" FontSize="16" HorizontalAlignment="Right" FontFamily="YouYuan" Foreground="White" Margin="0,19,0,26.186" d:LayoutOverrides="Height"/> <PasswordBox x:Name="passwordBox" Grid.Column="1" Grid.Row="1" Margin="3,10,0,0" FontSize="24" Opacity="0.9" Height="34" VerticalAlignment="Top"/> </Grid> <Button x:Name="after" Content="设置" Grid.Row="2" HorizontalAlignment="Right" Margin="0,22,47,8" Width="73.5" FontSize="20" Cursor="Hand" /> <Button x:Name="after_Copy" Grid.Row="2" Margin="96.5,22,167.5,8" FontSize="20" Cursor="Hand" Content="登录" Click="after_Copy_Click" /> </Grid> <Canvas Margin="176,64,180,150"/> </Grid> </Window>
标签: wpf
网友评论
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
支持(0) 盖楼(回复)