简体   繁体   中英

Graphics/Bitmap Limits?

Im having some weird problems with Graphics and Bitmap.

I have a Graphics Object that is displayed on a PictureBox and im capturing the MouseMove and MouseClick Events that give X and Y Position of the Mouse on the Image but if the Y Position goes Bigger then 32775 it then goes into Negatives which means everything breaks. And if the Image is Bigger then 65535 it then stops displaying the Image.

Any Ideas how these problems can be fixed?

Thanks

Example Code:

http://pastebin.com/YEX0XD1q

Just Click Make 10,000 Bigger about 4 times then scroll down and on the right it will show the mouse X and Y position and as you move down through the image and hover over the Red Area if you go down enough it will go into Negative Y.

By Researching i've managed to solve my problem

  1. Dont Use PictureBox inside Panel, Instead use ScrollableControl. This will fix the Problem where i couldn't make something bigger then 65K Height.
  2. Use GetVirtualMouseLocation to get Virtual Mouse Positions

I Just used what was posted here

The Above Works Perfectly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM