Mouse move (hover) over an Image with Graphics drawings
-
Hi All, I have an image on which I'm drawing elements ("masks") using a Graphics object (g.DrawCurve, g.FillRectangle, g.DrawPolygon etc.). Now, when hovering with the mouse over the image, I need to know whether I'm hovering over a mask (a part that was drawn using the Graphics object). I couldn't find a way to get a Graphic's drawing pixels... any ideas? Thanks!
-
Hi All, I have an image on which I'm drawing elements ("masks") using a Graphics object (g.DrawCurve, g.FillRectangle, g.DrawPolygon etc.). Now, when hovering with the mouse over the image, I need to know whether I'm hovering over a mask (a part that was drawn using the Graphics object). I couldn't find a way to get a Graphic's drawing pixels... any ideas? Thanks!
One thing you could do is this: - have a bitmap ("bm") the same size as the object you are drawing on, then get its graphics ("gbm") and fill with a white backcolor; - mimic all your drawing on gbm too, using any color but white; - when you need to know whether a point (x,y) is mask or not, look at bm.GetPixel(x,y) and the color will tell you. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum