0

I have been trying to place a marker at the mouse location on an image when the user clicks on the image box, the problem is that the marker has a certain offset which is exponential, and I think it's because the image size is not equal to the image box size. I also want to place the marker after zooming in on the image.

This is a windows forms project and it uses emgucv, OpenCV, and c++/cli.

Note I place the marker using an OpenCV function by passing the mouse click coordinates.

Can anyone please help?.

GHOST
  • 1
  • 1
    [This post](https://stackoverflow.com/a/38977660/3110834) may help. It handles click event on picture box, then convert the location to a point on the image. – Reza Aghaei Mar 01 '21 at 19:48

1 Answers1

0

I found the solution in this article https://www.codeproject.com/Articles/20923/Mouse-Position-over-Image-in-a-PictureBox you need to translate the PictureBox coordinates to image coordinates however, it depends on the size mode of the PictureBox.

GHOST
  • 1