T
trant
I have a program which draws rectangular ships onto a very large image.
To accomplish this the best way I knew how was to extend a Panel into a
custom panel and I overrode the Paint method. I draw all my shapes to an
image in another method and then w/ double buffering draw that prepared image
everytime Paint is called.
Now I'd like to implement mouse events for my shapes and am wondering what
would be the best approach - most economical and easiest.
The rendered image is always sufficiently larger than the viewable area
meaning scrollbars will always come into play. So the brute force method of
just iterating through all my shapes and seeing if the mouse x,Y is inside
their boundaries seems quite the poor choice but I dont really know a better
way without much experience in this.
What would you do in this situation?
To accomplish this the best way I knew how was to extend a Panel into a
custom panel and I overrode the Paint method. I draw all my shapes to an
image in another method and then w/ double buffering draw that prepared image
everytime Paint is called.
Now I'd like to implement mouse events for my shapes and am wondering what
would be the best approach - most economical and easiest.
The rendered image is always sufficiently larger than the viewable area
meaning scrollbars will always come into play. So the brute force method of
just iterating through all my shapes and seeing if the mouse x,Y is inside
their boundaries seems quite the poor choice but I dont really know a better
way without much experience in this.
What would you do in this situation?