读书人

求silverlight卡通片效果

发布时间: 2013-03-10 09:38:39 作者: rapoo

求silverlight动画效果
以下两个silverlight动画怎么实现,求解
http://www.neodynamic.com/demo-faq/barcode-silverlight/134/SilverlightBarcodePhotoIdCardOnline/Default.htm
http://www.tutq.com/
[解决办法]
用Blend直接画的简单的,有两个Button,在转过去后第二个Button显示出来,其实原理和你那个一样的。
如果你不想看慢慢显示出来!就通过Visible来设置。一样的


<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="SilverlightApplication11.MainPage"
Width="800" Height="600">
<StackPanel x:Name="stackPanel" Margin="103,114,273,143" Background="#FFFFFDFD">
<StackPanel.Projection>
<PlaneProjection/>
</StackPanel.Projection>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="VisualStateGroup">
<VisualState x:Name="VisualState">
<Storyboard>
<DoubleAnimation Duration="0:0:1" To="-179" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="stackPanel" d:IsOptimized="True"/>
<DoubleAnimation Duration="0:0:1" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="button" d:IsOptimized="True"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Button Content="Button" Height="112" Margin="94,0,154,0"/>
<Button x:Name="button" Content="button" Height="113" Margin="57,0,141,0" Opacity="0"/>
</StackPanel>
</UserControl>
[解决办法]
其实就是两个自定义控件一个是这面一个是那面,然后转动时一个隐藏一个显示,你最好通过Blend直接去画。。想要什么效果自己搞就行了。。
[解决办法]
自定义控件 定义它所依赖的属性FrontContent和BackContent ,定义TemplateVisualState Normal和Flip 然后用Transitions改变动画(Normal>Flip)or(Flip>Normal) 通过按钮事件改变IsFlip判断是获取Nomal状态还是Flip状态 来响应动画

读书人网 >CAD教程

热点推荐