RectContainsPoint() публичный Метод

Determines if the Bounds contains the specified PointF.
If it is already know that the PointF fits on the Line at some location, then this is an inexpensive operation to see if the PointF is within the current Line segment.
public RectContainsPoint ( PointF pt ) : bool
pt Evbpc.Framework.Drawing.PointF The to test.
Результат bool
Пример #1
0
        public static PointF? Intersect(Line l1, Line l2)
        {
            var intPoint = IntersectForever(l1, l2);

            if (intPoint == null)
            {
                return null;
            }

            // So we know the intersection point were the lines extended forever, we just need to see if the point fits on our source lines.
            if (l1.RectContainsPoint(intPoint.Value) && l2.RectContainsPoint(intPoint.Value))
            {
                return intPoint;
            }

            return null;
        }
Пример #2
0
        public static PointF?Intersect(Line l1, Line l2)
        {
            var intPoint = IntersectForever(l1, l2);

            if (intPoint == null)
            {
                return(null);
            }

            // So we know the intersection point were the lines extended forever, we just need to see if the point fits on our source lines.
            if (l1.RectContainsPoint(intPoint.Value) && l2.RectContainsPoint(intPoint.Value))
            {
                return(intPoint);
            }

            return(null);
        }