本文共 1651 字,大约阅读时间需要 5 分钟。
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;namespace 使用path制作各类型动画路径{ ////// MainWindow.xaml 的交互逻辑 /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { //设置红色椭圆的Storyboard中"MatrixAnimationUsingPath"的PathGeometry PathGeometry pg = new PathGeometry(); pg.AddGeometry(elipsGeome); matUsePath.PathGeometry = pg; //ellipse1 开始绕椭圆路径旋转 sb1.Begin(ellipse1); } }}
源代码下载:
转载地址:http://kvwza.baihongyu.com/