views:

45

answers:

1

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.

A: 

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.

Dean