Skip to main content
Home Forums Silverlight Programming Programming with JavaScript Possible to get Canvas metadata at mouse position?
1 replies. Latest Post by WynApse on June 2, 2007.
(0)
jlermanvt
Member
16 points
7 Posts
06-02-2007 8:33 PM |
I would like to respond to a mouse click event and get some information (more than x and y values) about the mouse position. Specifically, I would like to find out the color of the object (which is filled with a gradient brush) at a particular point. I have not been able to figure this out. Is it even possible?
WynApse
Star
8456 points
342 Posts
06-02-2007 9:26 PM |
We don't have hit-testing as such, but if one of your objects caused the event, you can get information about that object.
ZIndex comes into play, and Opacity 0 objects that are not hidden will sneak up and bite you when you don't expect it.
I use the mouse event to get a name, append some text to the name, and go get another objects information that I then use in my menu.
If, however, your mouse event is on the canvas and it contains a whole bunch of objects, then you're probably out of luck...
-Dave