RectContainsPoint() public méthode

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.
Résultat bool
Exemple #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;
        }
Exemple #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);
        }