Using both .IsOutlineVisible and .IsVisible together covers the whole thing, the border and inside the border, for this example rectangle, but as you know, GraphicsPath can work for different shapes.
bool b = gp.IsVisible(point) || gp.IsOutlineVisible(point, pen);
For this in code
Rectangle r = new Rectangle(new Point(50, 100), new Size(500, 100)); bool b; // say Point p is set. // say Pen pen is set. using (var gp = new GraphicsPath()) using (var pen = new Pen(Color.Black, 44)) { gp.AddRectangle(r); bool b = gp.IsVisible(point) || gp.IsOutlineVisible(point, pen); }
barlop
source share