title: How I get the X and the Y point of a image from a MouseEvent?
body: <p>I have a image editing program and need the X and the Y coordinate of the image. At the moment I use the MouseLeftButtonDown and MouseRightButtonDown event.</p>
  
  <pre><code>&lt;Image Name="Image" MouseLeftButtonDown="MouseLeftButtonDown_Click" MouseRightButtonDown="MouseRightButtonDown_Click"&gt;&lt;/Image&gt;
  </code></pre>
  
  <p>The problem I have is that I don't geht the right position on the picture in my WPF form. Means, if I drag the window smaller the coordinate is changing.</p>
  
  <p>My method looks like this:</p>
  
  <pre><code>private void MouseLeftButtonDown_Click(object sender, System.Windows.Input.MouseButtonEventArgs e)
  {
      System.Windows.Point p = e.GetPosition(null);
      MessageBox.Show(p.X.ToString());
  }
  </code></pre>
  
  <p>I think that the problem is that I add <code>null</code> as a argument in <code>e.GetPosition</code>. But I don't know what I have to add here otherwise...</p>
  
  <blockquote>
    <p>For example I open a 1920x1080 image I really want 1920 and 1080 if I
    press the mouse at the right bottem corner.</p>
  </blockquote>