惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

博客园 - 碧血黄沙-java、c#

nginx反向代理tomcat应用,struts2网站程序redirect时导致请求地址错误的解决方法 开源一个最近写的spring与mongodb结合的demo(spring-mongodb-demo) 基于spring框架的apache shiro简单集成 java的struts2项目实现网站首页只显示域名不显示index.do的做法 用WPF开发仿QQ概念版之--------MessageWindow开发以及Demo下载 用WPF开发仿QQ概念版之--------Loading预加载界面(闪屏窗体) 纪念一下我在2009年开发的一款网站客户端软件[winform] 参考XNA官方Platformer模版,修改Platformer为横版可以滚动的小游戏 Xna小游戏开发【飞机空间大战】 Airfey Radio网络电台播放器V2.0绿色单文件版本发布(大小仅296KB) 一种开发软件的新思路,给Web页面穿个马甲,用web页面做软件UI,用C#(或者C++等其它语言)代码做功能 Airfey Radio网络电台播放器V2.0版本发布(2010.4.18最新更新) Airfey Radio网络电台播放器V1.0.0.0版本发布(2010.1.29更新)此版本不再更新,转入2.0版本开发 网络电台播放器即将开放下载,敬请期待!!! 在WinForm里面使用多线程修改主线程上的一个Label的值 在几千条记录里,存在着些相同的记录,如何能用SQL语句,删除掉重复的呢? 发布Winform自定义控件snMessageBox,基于系统的MesssageBox实现重绘,需要源码者请留下邮箱 [原创]WinForm中重绘滚动条以及用重绘的滚动条控制ListBox的滚动 高仿QQMusic播放器,浅谈WinForm关于UI的制作
用WPF开发仿QQ概念版之--------登录界面
碧血黄沙-java、c# · 2011-02-10 · via 博客园 - 碧血黄沙-java、c#

自从安装了WIN7并试用了腾讯的概念版QQ后,心中总是对登录界面那漂浮的白云、来回摆动的绿叶感兴趣,惊叹于WPF的强大(特别是动画实现)。实在忍不住了,决定试着自己开发一个“类似”的东东。

声明一下下:本文章本着学习技术的目的,部分素材来自腾讯QQ概念版本(有些是导出的图片素材、有些则是本人截图后进行的图片处理),严禁任何人用于商业用途,否则后果自负。

先把我制作的效果秀一下:

XAML代码如下: 

代码

<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" mc:Ignorable="d"
 x:Class
="WpfQQ.LoginWindow"
 x:Name
="Window"
 Title
="QQ"
  
 Width
="369" Height="292" WindowStyle="None"
 Background
="{x:Null}"  AllowsTransparency="True" MouseLeftButtonDown="Window_MouseLeftButtonDown" WindowStartupLocation="CenterScreen" Icon="/WpfQQ;component/Images/logo32.ico">
 
<Window.Resources>
  
<Storyboard x:Key="StoryboardCloud" RepeatBehavior="Forever">
   
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="image2">
    
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
    
<EasingDoubleKeyFrame KeyTime="0:0:15" Value="153"/>
    
<EasingDoubleKeyFrame KeyTime="0:0:20" Value="190"/>
   
</DoubleAnimationUsingKeyFrames>
   
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image2">
    
<EasingDoubleKeyFrame KeyTime="0:0:15" Value="1"/>
    
<EasingDoubleKeyFrame KeyTime="0:0:20" Value="0.05"/>
   
</DoubleAnimationUsingKeyFrames>
   
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="txtUserName">
    
<EasingDoubleKeyFrame KeyTime="0:0:15" Value="1"/>
   
</DoubleAnimationUsingKeyFrames>
   
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="txtUserName">
    
<EasingColorKeyFrame KeyTime="0" Value="#FFF3F5F5"/>
    
<EasingColorKeyFrame KeyTime="0:0:15" Value="#FFF3F5F5"/>
   
</ColorAnimationUsingKeyFrames>
  
</Storyboard>
  
     
<!--定义按钮样式-->
        
<Style x:Key="buttonTemplate" TargetType="Button" >
            
<!--修改模板属性-->
            
<Setter Property="Template">
                
<Setter.Value>
                    
<!--控件模板-->
                    
<ControlTemplate TargetType="Button">
                        
<!--只有Grid才能装下这么多Child-->
                        
<Grid Background="Yellow">
                            
<!--带特效的底层背景-->
                            
<Border x:Name="back" Opacity="0.8" CornerRadius="2">
                                
<Border.BitmapEffect>
                                    
<OuterGlowBitmapEffect Opacity="0.8" GlowSize="0" GlowColor="Red" />
                                
</Border.BitmapEffect>                                
                                
<Ellipse Width="49" Height="49">
                                    
<Ellipse.Fill>
                                        Red
                                    
</Ellipse.Fill>
                                
</Ellipse>
                            
<!--按钮呈圆形-->
                            
</Border>                            
                            
<Ellipse x:Name="outerCircle" Width="50" Height="50">
                                
<Ellipse.Fill>
                                    
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        
<GradientStop Offset="0" Color="DarkOliveGreen"/>
                                        
<GradientStop Offset="1" Color="Azure"/>
                                    
</LinearGradientBrush>
                                
</Ellipse.Fill>
                            
</Ellipse>
                            
<Ellipse Width="40" Height="40">
                                
<Ellipse.Fill>
                                    
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        
<GradientStop Offset="0" Color="White"/>
                                        
<GradientStop Offset="1" Color="Transparent"/>
                                    
</LinearGradientBrush>
                                
</Ellipse.Fill>
                            
</Ellipse>
                            
<!--按钮内容-->
                            
<Border>                                
                                
<TextBlock x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{TemplateBinding  Content}">
                                
</TextBlock>
                            
</Border>
                        
</Grid>
                        
<!--触发器-->
                        
<ControlTemplate.Triggers>
                            
<Trigger Property="Button.IsMouseOver" Value="True">
                                
<Trigger.EnterActions>
                                    
<BeginStoryboard>
                                        
<Storyboard>
                                            
<DoubleAnimation To="10" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
                                            
<ColorAnimation To="#4FFF" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="outerCircle" Storyboard.TargetProperty="(Ellipse.Fill).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
                                            
<ColorAnimation To="#3FFF" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="outerCircle" Storyboard.TargetProperty="(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
                                        
</Storyboard>
                                    
</BeginStoryboard>
                                
</Trigger.EnterActions>
                                
<Trigger.ExitActions>
                                    
<BeginStoryboard>
                                        
<Storyboard>
                                            
<DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
                                            
<ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="outerCircle" Storyboard.TargetProperty="(Ellipse.Fill).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
                                            
<ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="outerCircle" Storyboard.TargetProperty="(Ellipse.Fill).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
                                        
</Storyboard>
                                    
</BeginStoryboard>
                                
</Trigger.ExitActions>
                            
</Trigger>
                            
<Trigger Property="Button.IsPressed" Value="True">
                                
<Setter Property="RenderTransform">
                                    
<Setter.Value>
                                        
<ScaleTransform ScaleX=".9" ScaleY=".9"/>
                                    
</Setter.Value>
                                
</Setter>
                                
<Setter Property="RenderTransformOrigin" Value=".5,.5"/>
                            
</Trigger>
                        
</ControlTemplate.Triggers>
                    
</ControlTemplate>
                
</Setter.Value>
            
</Setter>
        
</Style>
        
<Storyboard x:Key="StoryboardLeaf" RepeatBehavior="Forever">
         
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="image1">
          
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
          
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="13"/>
          
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
         
</DoubleAnimationUsingKeyFrames>
         
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="image">
          
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
          
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="13"/>
          
<EasingDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
         
</DoubleAnimationUsingKeyFrames>
        
</Storyboard></Window.Resources>
 
<Window.Triggers>
  
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
   
<BeginStoryboard Storyboard="{StaticResource StoryboardCloud}"/>
   
<BeginStoryboard Storyboard="{StaticResource StoryboardLeaf}"/>
  
</EventTrigger>
 
</Window.Triggers>
 
<Grid x:Name="LayoutRoot" Width="370" Height="370">
  
<Grid.ColumnDefinitions>
   
<ColumnDefinition Width="0.935*"/>
   
<ColumnDefinition Width="0.065*"/>
  
</Grid.ColumnDefinitions>
  
<Image x:Name="image5" HorizontalAlignment="Left" Height="53" Source="sun2.png" Stretch="Fill" VerticalAlignment="Top" Width="105" RenderTransformOrigin="0.5,0.5" Margin="-3,-2,0,0">
   
<Image.RenderTransform>
    
<TransformGroup>
     
<ScaleTransform/>
     
<SkewTransform/>
     
<RotateTransform/>
     
<TranslateTransform/>
    
</TransformGroup>
   
</Image.RenderTransform>
  
</Image>
  
<Image x:Name="image3" Margin="-2,43,6,81" Source="loginbody.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" Grid.ColumnSpan="2" Width="366" Height="246">
   
<Image.RenderTransform>
    
<TransformGroup>
     
<ScaleTransform/>
     
<SkewTransform/>
     
<RotateTransform/>
     
<TranslateTransform/>
    
</TransformGroup>
   
</Image.RenderTransform>
  
</Image>
  
<Image x:Name="image2" Height="50" Margin="-14,7,170.11,0" Source="cloud.png" Stretch="Fill" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
   
<Image.RenderTransform>
    
<TransformGroup>
     
<ScaleTransform/>
     
<SkewTransform/>
     
<RotateTransform/>
     
<TranslateTransform/>
    
</TransformGroup>
   
</Image.RenderTransform>
  
</Image>
  
<Image x:Name="image4" Height="82" Margin="16,17,0,0" Source="yezi2.png" Stretch="Fill" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Grid.ColumnSpan="2">
   
<Image.RenderTransform>
    
<TransformGroup>
     
<ScaleTransform/>
     
<SkewTransform/>
     
<RotateTransform/>
     
<TranslateTransform/>
    
</TransformGroup>
   
</Image.RenderTransform>
  
</Image>
  
<Image x:Name="image1" HorizontalAlignment="Left" Height="35.368" Margin="75,51,0,0" Source="yezi3.png" Stretch="Fill" VerticalAlignment="Top" Width="37" RenderTransformOrigin="1.135,-1.103">
   
<Image.RenderTransform>
    
<TransformGroup>
     
<ScaleTransform/>
     
<SkewTransform/>
     
<RotateTransform/>
     
<TranslateTransform/>
    
</TransformGroup>
   
</Image.RenderTransform>
  
</Image>
  
<Button x:Name="button" Content="X" Template="{StaticResource temp_b_top_close}"   HorizontalAlignment="Right" Height="22" Margin="0,67.368,-3.89,0" VerticalAlignment="Top" Width="22" RenderTransformOrigin="0.5,0.5" Click="button_Click">
   
<Button.RenderTransform>
    
<TransformGroup>
     
<ScaleTransform/>
     
<SkewTransform/>
     
<RotateTransform/>
     
<TranslateTransform/>
    
</TransformGroup>
   
</Button.RenderTransform>
  
</Button>
  
<TextBox x:Name="txtUserName" Margin="75,121,62.11,0" TextWrapping="Wrap" Text="" BorderThickness="0" Height="18" VerticalAlignment="Top" Background="#FFF3F5F5" />
  
<Button Content="登  录" Margin="0,0,48.11,111.5" Height="30" Click="Button_Click" VerticalAlignment="Bottom" d:LayoutOverrides="Height" HorizontalAlignment="Right" Width="122"/>
  
<Button x:Name="RegButton" Content="注册新帐号" Margin="61,0,0,111" HorizontalAlignment="Left" Width="74" Height="30" VerticalAlignment="Bottom" d:LayoutOverrides="Height" Click="RegButton_Click"/>
  
<CheckBox Content="CheckBox" HorizontalAlignment="Right" Height="21" Margin="0,0,105.11,149.5" VerticalAlignment="Bottom" Width="21"/>
  
<Image x:Name="image" Height="65" Margin="133,63,145.11,0" Source="yezi3.png" Stretch="Fill" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
   
<Image.RenderTransform>
    
<TransformGroup>
     
<ScaleTransform/>
     
<SkewTransform/>
     
<RotateTransform/>
     
<TranslateTransform/>
    
</TransformGroup>
   
</Image.RenderTransform>
  
</Image>
  
<Button x:Name="button_mini" Content="X" Template="{StaticResource temp_b_mini_close}"   HorizontalAlignment="Right" Height="22" Margin="0,68.368,14.11,0" VerticalAlignment="Top" Width="22" RenderTransformOrigin="0.5,0.5" Click="button_mini_Click">
   
<Button.RenderTransform>
    
<TransformGroup>
     
<ScaleTransform/>
     
<SkewTransform/>
     
<RotateTransform/>
     
<TranslateTransform/>
    
</TransformGroup>
   
</Button.RenderTransform>
  
</Button>
  
<PasswordBox x:Name="txtPassWord" Margin="75,170.5,74.11,181.5" Width="196.84" BorderThickness="0" Background="#FFF3F5F5">
   
<PasswordBox.BorderBrush>
    
<LinearGradientBrush EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
     
<GradientStop Color="#FFABADB3" Offset="0.05"/>
     
<GradientStop Color="#FFE2E3EA" Offset="0.07"/>
     
<GradientStop Color="#FFF3F5F5" Offset="1"/>
    
</LinearGradientBrush>
   
</PasswordBox.BorderBrush>
  
</PasswordBox>
  
 
</Grid>
</Window>

随后放出DEMO......感谢关注

 放一个好友管理效果吧