Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in WPF, has anyone ever used the function StrokeContains() function to check whether a Geometry (Circle, Rectangle, line...) has been clicked and selected by the Mouse click in a Canvas? I could not make it work.

or Altenatively, if I can know all the points within each Geometry, then I could also directly check by comparing the mouse position to each point of the Geometry, but how to get all the points of a Geometry then?
thank you!

What I have tried:

I have tried using StrokeContains(), and srangly, the results indicate that all the Geometries have been selected by a single mouse click. It is difficult to debug it.
Posted
Comments
[no name] 10-Apr-20 21:48pm    
Guesstimate.

https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.geometry.bounds?view=netframework-4.8

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900