How to know if a GraphicsPath contains a point in C#

前端 未结 2 886
孤街浪徒
孤街浪徒 2021-01-11 23:36

I\'m using .NET to draw a diagram, and I want to highlight objects when the user performs a click on them. It is easy when a figure is fully contained in a

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-12 00:25

    I don't know a DrawingPath (you mean probably; graphics.DrawPath) but a GraphicsPath has the IsVisible method to check if a point is in the path.

    bool isInPath = graphicsObj.IsVisible(point)
    

提交回复
热议问题