coordinates - WPF how to show an Image.Source (BitmapSource) pixel position? -
Let's say I've got an image that shows my source in a detailed way, how can I use a mouse event to show?
(I do not need to direct pixels to the coordinates of the image relative to its size)
thanks in advance / P>
You can find actual pixel height and width from ImageSource.
ImageSource imageSource = image.Source; Bitmap image bitmap image = (bitmap image) imageSource;
Now since you got the image displayed in the image control. You can easily map the position of the mouse on the pixel scale.
PixelMosposePx = E. GetPhin (Image) X * bitmap image Pixelwidth / image Wide; PixelMousePositionY = E. GetPosition (Image). Y * bitmapImage.PixelHeight / image.Height;
Have fun
Comments
Post a Comment