Interviews - C# Corner

Murali Reddy
How to Move An Ellipse in Wpf Using Canvas in some Angle??
By Murali Reddy in XAML onAug 24 2013
  • Murali Reddy
    Aug, 2013 24

    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));
    }

    • 0

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS