Sounds as if you want the position with respect to the pixels of the original image, no matter what size the containing window is.
This should help...
private void MouseLeftButtonDown_Click(object sender, MouseButtonEventArgs e)
{
System.Windows.Point p = e.GetPosition(image);
double pixelWidth = image.Source.Width;
double pixelHeight = image.Source.Height;
double x = pixelWidth * p.X / image.ActualWidth;
double y = pixelHeight * p.Y / image.ActualHeight;
MessageBox.Show(x + ", " + y);
}
I renamed your image to "image" to resolve the conflict between image name and class name. Update your XAML as follows:
<Image Name="image" MouseLeftButtonDown="MouseLeftButtonDown_Click" MouseRightButtonDown="MouseRightButtonDown_Click"></Image>
pixelWidth and pixelHeight are the original width and height of the source image. x and y are calculated according the ratio between the original pixel width/height and the actual displayed width/height of the image on screen.
To display whole pixels in the popup message, use this instead:
MessageBox.Show((int)x + ", " + (int)y);
@Gerret: please can you give a few examples of the wrong coordinates, and what you were expecting them to be?