Exemple #1
0
        private void btnAnimate2_Click(object sender, RoutedEventArgs e)
        {
            CarDrawing myCar  = new CarDrawing();
            Path       myPath = new Path();

            myPath = myCar.relative();

            ObjectTransform objTran = new ObjectTransform();

            objTran.animBYDA(myPath);
            MyCanvas.Children.Add(myPath);
        }
Exemple #2
0
        private void btnAnimate_Click(object sender, RoutedEventArgs e)
        {
            CompositionTarget.Rendering += DrawCar;
            CarDrawing myCar  = new CarDrawing();
            Path       myPath = new Path();

            myPath = myCar.relative();
            ObjectTransform objTran = new ObjectTransform();

            MyCanvas.Children.Add(myPath);
            Storyboard sb = objTran.animByStoryboard(myPath);

            sb.Begin(MyCanvas);
        }