I need to get element from canvas by given point.
For example I have Rectangle on Canvas, which CanvasLeft and CanvasTop values are setted to some values.
I whant get element from canvas which CanvasLeft and CanvasTop vaules are for example 10 and 40.
Is it possible?
Thanks.
How can I get element from given point on canvas?
1.2k Views Asked by Samvel Siradeghyan At
2
You can find the elements a specific position by using the VisualTreeHelper. It has a method FindElementsInHostCoordinates. You'll have to give it a host, for example the canvas and the coordinates and it returns a list of UIElements.
Here's the info on MSDN: http://msdn.microsoft.com/en-us/library/cc838402(v=VS.95).aspx