To overlay the icons I'm just handling the PictureBox paint event as such:
private List<VRIcon> overlayIcons = new List<VRIcon>();
...
private void VRScrollableImage_Paint(object sender, PaintEventArgs e)
{
foreach (VRIcon ico in overlayIcons)
{
if ((ico != null) && ico.Visible && (ico.Image != null))
{
e.Graphics.DrawImage(ico.Image, ico.Location);
}
}
}
Which works well enough but there doesn't seem to be a 'simple' way to detect and handle mousing over of each icon.
My idea to do this at the moment is to handle MouseMove events in the PictureBox and send the mouse coords to every visible overlayed icon and do a primitive collision check based on the mouse coords and the icon dimensions.
Is this the best way to go about this? Is there a cleaner way to do it in a C# WinForm application? It doesn't seem particularly clean or efficient but I'm not sure how else I would go about it.
Thanks.

New Topic/Question
Reply




MultiQuote





|