WPF實現遊戲背景效果
阿新 • • 發佈:2020-11-28
前言
在使用一些應用的時候會發現等待介面做的使用者體驗很好,所以打算使用wpf實現一篇。
效果圖預覽
- 第一步需要一張無縫背景圖片(PS 圖片地址)。
- 準備飛機圖片。
- XAML程式碼。
<Window.Resources> <ImageBrush x:Key="freeMachineImageBrush" ImageSource="/Images/飛機132x48.png"/> </Window.Resources> <Canvas Name="myCanvas" Focusable="True"> <Rectangle Name="
- 後臺程式碼。
//建立定時器 DispatcherTimer timer = new
Start();