When you use a geometry for the hit test parameter is there a way to get the point of intersection (i.e. hit) between the two geometries, right now it only says that it has been hit and the HitTestResult from what I can see doesn't provide any such info.
Asked
Active
Viewed 862 times
0
-
If you use an `EllipseGeometry` and you get a `Button` for example in the HitTest Callback then the intersection is an area and not a point. It's like the overlap of a rectangle and a circle. I'm not sure what you're asking here. – Fredrik Hedblad Sep 07 '11 at 14:16
-
@Meleak, in my case the intersection is only a point(s), for example a line and some shape like ellipse. Even if I wanted the geometry how can i get the geometry from HitTestResult, because maybe then I can use the bounds property to get the coordinates of where the new geometry is? – mihajlv Sep 07 '11 at 15:22
1 Answers
0
I don't think it can be done. If you are looking for finding the intersection between two geometries look at this.
-
WPF contains a hittesting framework that is incredibly helpful for determining what to test with what, but when you dive into *drawing* on your own, you often need to write your HitTestCore - because only you (as the 'artist') are able to tell what is what.On the other hand,if you use existing toplevel classes-hit testing just works. Maybe your problem is just in that you delved too deep? Maybe you just used a wrong tool to solve previous problem? Have you tried assembling your graphics into a UserControl with canvas and many System.Windows.Shape.Path/Line/Elipse instead of drawing geometries? – quetzalcoatl Dec 06 '11 at 12:05