C# OnClick .NET framework coordinate limitation

56 Views Asked by At

i'm implementing a C# user control (panel) with a picturebox inside. The picturebox is scaled to zoom in and is code painted (basically a vertical ruler that contains some information in correspondence of some of the values), while the panel is used to provide scrolling capabilities to allow user to view only the part of the image of interest.

Once the image reaches and pass the 32768 size (X or Y) all mouse clicks that have X or Y above this limit will NOT trigger the Click / MouseClick events. Simply not detected at all. I think it's a .NET limit, but i wonder if there is a way to override it.

Thanks

1

There are 1 best solutions below

0
Daniele Pistollato On

I've found that, despite Point is defined as int32 struct, the MouseClick and Click events are only able to work on coordinates <= of a SHORT(32768). That means the event is NOT FIRED if you click on a coordinate that is higher than the SHORT maximum value of 32768. That seems a .NET framework limitation. I've bypassed working without large images inside a panel but painting only the visible area on each change