自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

詳解Silverlight3中實現(xiàn)按路徑運動

開發(fā) 后端
在這里我們將討論的是Silverlight3中實現(xiàn)按路徑運動,希望對大家有所幫助。

對于Silverlight大家并不陌生,但是對于如何在Silverlight3中實現(xiàn)按路徑運動,還是值得大家注意的。希望看過本文對大家有所幫助。

這幾天需要給終端機做個一組Logo沿圓形軌跡轉(zhuǎn)動效果, 直接用Winform實現(xiàn)太卡(通過不斷繪圖方式), 考慮到SL3可以脫機運行, 就用它來實現(xiàn).

網(wǎng)上也找了很多教程, 發(fā)現(xiàn)沒有較好的方法, ***自己"研究"出一種可行的方法, 供大家討論:

1.運行效果:

運行效果

  1. Code  
  2. <Window x:Class="SLTest.test" 
  3.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  4.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  5.     Title="test" Height="600" Width="800"> 
  6.     <Window.Resources> 
  7.         <Storyboard x:Key="Storyboard1"> 
  8.             <PointAnimationUsingPath Storyboard.TargetName="MyAnimatedEllipseGeometry" Storyboard.TargetProperty="Center" Duration="0:0:5" RepeatBehavior="Forever"> 
  9.                 <PointAnimationUsingPath.PathGeometry> 
  10.                     <PathGeometry Figures="M 299.9 300 A 100,100 360 1 1 300.1,300 Z"/> 
  11.                 </PointAnimationUsingPath.PathGeometry> 
  12.             </PointAnimationUsingPath> 
  13.         </Storyboard> 
  14.     </Window.Resources> 
  15.     <Window.Triggers> 
  16.         <EventTrigger RoutedEvent="FrameworkElement.Loaded"> 
  17.             <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/> 
  18.         </EventTrigger> 
  19.     </Window.Triggers> 
  20.     <Grid> 
  21.         <Path x:Name="pt" Stroke="Black" Fill="Gray" Data="M 299.9 300 A 100,100 360 1 1 300.1,300 Z" /> 
  22.         <Path Fill="Blue"> 
  23.             <Path.Data> 
  24.                 <!-- Describes an ellipse. --> 
  25.                 <EllipseGeometry x:Name="MyAnimatedEllipseGeometry" 
  26.              Center="300,300" RadiusX="15" RadiusY="15" /> 
  27.             </Path.Data> 
  28.         </Path> 
  29.     </Grid> 
  30. </Window> 

相信大家都能看得懂代碼的意思, 這里由于時間原因(馬上要下班走人了)我就不多啰嗦了, 大家有什么好的方案也歡迎一同討論.

原文標(biāo)題:Silverlight3實現(xiàn)按路徑運動[原創(chuàng)]

鏈接:http://www.cnblogs.com/yimi329/archive/2009/11/17/1604822.html

責(zé)任編輯:彭凡 來源: 博客園
相關(guān)推薦

2009-12-31 15:01:07

Silverlight

2009-04-23 10:08:03

Silverlight兼容開發(fā)

2009-08-12 10:47:38

Silverlight

2009-07-14 13:28:56

SketchFlow原型設(shè)計工具Expression

2009-03-19 15:52:50

Silverlight位圖WPF

2009-07-24 18:03:44

2009-07-08 09:28:26

Silverlight

2009-02-20 08:54:20

DownloaderSilverlight對象

2009-07-14 11:03:07

Expression SketchFlowSilverlight

2010-01-04 10:17:16

Silverlight

2010-01-04 13:09:51

Silverlight

2009-07-24 13:37:29

SilverlightSilverlight

2009-07-11 23:32:51

2009-07-14 15:34:17

Silverlight

2009-03-16 10:00:01

文件同步LivemeshSilverlight

2010-04-23 13:23:42

Silverlight

2009-05-31 09:01:46

Silverlight3DExpression

2009-02-02 10:53:34

SilverlightSilverlightRIA

2009-07-10 11:45:52

HTML 5

2009-06-25 11:18:20

Silverlight
點贊
收藏

51CTO技術(shù)棧公眾號