Problems encountered in. NET Programming for beginners (9)

Source: Internet
Author: User

I have shown a picture in picturebox. The sizemode of picturebox is set to zoom. The size of picturebox is 800*600, and the size of the image is 2848*4256. That is to say, the image I want to display is much larger than picturebox. I move the mouse to picturebox and use e in the move event of picturebox. x, E. y, you can only get the coordinates of the mouse in picturebox.

Question: How can I get the coordinates of the mouse in the image? Could you help me solve this problem? Thank you !!!

You can use the coordinates in picturebox and the position of picturebox to obtain the coordinates relative to the form client, and then subtract the coordinates of the image to obtain the coordinates relative to the image, you can try it by following my methods.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.