silverlight翻页

 

查看Demo

另外,还可以将 Matrix3DProjection Matrix3D 类型用于比使用 PlaneProjection 可能更复杂的准三维方案。

示例代码:沿Y轴翻转:

XAML:

  
  
< Image Grid.Row ="1" Height ="147" HorizontalAlignment ="Left" Margin ="52,28,0,0" Name ="image1" Stretch ="Fill" VerticalAlignment ="Top" Width ="220" Source ="/SilverlightApplication1;component/images/61e44a60jw1dglvwijv8nj.jpg" > < Image.Projection > < PlaneProjection x:Name ="ppFlipImage" ></ PlaneProjection > </ Image.Projection > </ Image > < Button Content ="Button" Grid.Row ="1" Height ="23" HorizontalAlignment ="Left" Margin ="125,182,0,0" Name ="button1" VerticalAlignment ="Top" Width ="75" Click ="button1_Click" />

C#:

  
  
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Windows.Threading; namespace SilverlightApplication1 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); this .LayoutRoot.Loaded += new RoutedEventHandler(LayoutRoot_Loaded); } void LayoutRoot_Loaded( object sender, RoutedEventArgs e) { tmrY = new DispatcherTimer(); tmrY.Tick += tmrY_Tick; TimeSpan tsFlip = new TimeSpan( 0 , 0 , 0 , 0 , frequence); // 100 Milliseconds tmrY.Interval = tsFlip; } private int frequence = 10 ; private DispatcherTimer tmrY; private void button1_Click( object sender, RoutedEventArgs e) { // this.ppFlipImage.RotationY = (this.ppFlipImage.RotationY + 1) % 360; if ( ! tmrY.IsEnabled) { tmrY.Start(); } else { tmrY.Stop(); } } void tmrY_Tick( object sender, EventArgs e) { this .ppFlipImage.RotationY = ( this .ppFlipImage.RotationY + 1 ) % 360 ; } } }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值