1
Reply

How to Move An Ellipse in Wpf Using Canvas in some Angle??

Murali Reddy

Murali Reddy

Aug 24, 2013
2.5k
0

    First Findout the Canvas.Left and Canvas.Top properties of ellipse which we r gonna move.

    int x=0;
    timer_tick(sender,e)
    {
    double left=Canvas.getLeft(ellipse1);
    double top=Canvas.getTop(ellipse1);

     double a = Math.Cos((angle - x) * (Math.PI / 180));
                        x = x + 5;
                        ellipse1.SetValue(Canvas.LeftProperty, left + 20);
                        ellipse1.SetValue(Canvas.TopProperty, top - (20 * a));
    }

    Murali Reddy
    August 24, 2013
    0