Is it possible to detected where user clicked on a loaded image or a bitmap on a C# form ? . just need it to be independent to image not screen locations !
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, you don’t tell us how you are displaying the image, so I am forced to guess. I am assuming a picturebox displaying the image at it’s native resolution. So, in that case:
If your image is scaled you will need to do the math. Get the
WidthandHeightof the control and figure out the ratio between them and the dimensions of your image. Multiply the click position by that ratio.