예제 #1
0
        public static PointF GetWorldPointF(this IConvertWorldView t, PointF viewLocation)
        {
            Matrix matrix = t.GetWorldToViewMatrix();

            matrix.Invert();
            return(matrix.TransformPoint(viewLocation));
        }
예제 #2
0
        public static Rectangle GetViewRect(this IConvertWorldView t, RectangleF worldRect)
        {
            PointF pt   = worldRect.Location;
            PointF ptRB = new PointF(worldRect.Right, worldRect.Bottom);

            PointF[] pts    = new PointF[] { pt, ptRB };
            Matrix   matrix = t.GetWorldToViewMatrix();

            matrix.TransformPoints(pts);
            return(Rectangle.FromLTRB((int)pts[0].X, (int)pts[0].Y, (int)pts[1].X, (int)pts[1].Y).NormalizeRect());
        }
예제 #3
0
        public static PointF GetViewPointF(this IConvertWorldView t, PointF worldLocation)
        {
            Matrix matrix = t.GetWorldToViewMatrix();

            return(matrix.TransformPoint(worldLocation));
        }