Ellipse At X,Y Location

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    Ellipse At X,Y Location

    This is a XAML Question

    I want to draw a Ellipse when mouse is clicked on the canvas in a user control....

    im setting this to put the ellipse

    Code:
     Ellipse el = new Ellipse();
                el.Fill = Brushes.Black;
                el.Height = 15;
                el.Width = 15;
                el.Margin = new Thickness(e.GetPosition(objSurface).X, e.GetPosition(objSurface).Y, 0, 0);
                objSurface.Children.Add(el);
    objSurface is the Canvas on which the Ellipse is to be drawn
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    So what is the problem?

    Comment

    • ThatThatGuy
      Recognized Expert Contributor
      • Jul 2009
      • 453

      #3
      Now the problem in resolved....

      the problem now is

      I am drawing a table like layout in xaml user control.....

      i use line control to draw columns ..... i give a space if 15 between each vertical line....

      my question is when i try the same thing in Windows Forms using GDI+
      with the space of 15px between each columns....

      the distance between the vertical lines drawn in xaml and windows forms
      are not the same


      i know that Xaml uses DIP instead of screen pixels....

      but how'd i draw lines in pixels in xaml

      Comment

      Working...