網址
http://msdn.microsoft.com/zh-tw/netframework/cc963622.aspx
#13 2D 動畫 #1 – 宣告式動畫使用技巧
1. 如何在xaml檔建立動畫
storyboard 屬性設定
兩個屬性範例
a. autoReverse: 動畫執行完畢接下來會倒者執行, boolean
b. repeatDeavior: 是否重複執行,內建type , 要的話裡面輸入"Forver"
2. Triggers : 觸發事件讓物件的屬性作變化,
example: page.load 事件
3. 範例
a. 放大 : DoubleAnimation
b. 旋轉: DoubleAnimation
c. 顏色變換: ColorAnimation
d. 移動:PointAnimation
#14

事件的使用,如滑鼠 click事件
範例包含:
1. start : 最好將 StoryBorad命名 好讓其他功能能呼叫如 Pause, Resume,Stop
2. Pause: PauseStoryboard
3. Resume: ResumeStoryboard
4. Stop: StopStoryboard
#15

兩個範例
1. 變更寬度大小: DoubleAnimation
2. 變更顏色: ColorAnimation
3. TimeSpan的宣告方式: (時,分,秒)
4. 呼叫的方式用 BeginAnimation(屬性,物件)
以改變寬度為例 , 屬性 為 Rectangle.WidthProperty ,物件 如 DoubleAnimation
5. 可以用 Storyboard 的方式, add 需要使用animation(xxx.child.add) ,然後在一次呼叫
#16


1. 使用path 定義畫出路徑 (PathGeometry)
2. 範例有 從 xaml 檔 和 外部使用code控制的方法
沒有留言:
張貼留言