public struct FrameF
A two-dimensional lens on a a pair of (x,y) numeric intervals.

Constructors

FrameF

#
public FrameF(DomainF x, DomainF y)
Create a two-dimensional stretch from two one-dimensional stretches.
x (DomainF)Horizontal stretch.
y (DomainF)Vertical stretch.

FrameF

#
public FrameF(RectangleF boundary, double x0, double x1, double y0, double y1)
Create a two-dimensional stretch from a boundary rectangle and underlying limits.
boundary (RectangleF)Boundary (will be made increasing if it isn't).
x0 (double)Lowest x value within the frame.
x1 (double)Highest x-value within the frame.
y0 (double)Lowest y-value within the frame.
y1 (double)Highest y-value within the frame.

Properties

Boundary

#
public RectangleF Boundary { get; }
Gets the bounds for the frame.

IsNormalised

#
public bool IsNormalised { get; }
Gets whether the zoom factor is identical for the X and Y directions.

X

#
public DomainF X { get; }
Gets the horizontal stretch.

Y

#
public DomainF Y { get; }
Gets the vertical stretch.

Methods

Interpolate

#
public FrameF Interpolate(FrameF other, double factor)
Perform a linear interpolation between two frames.
other (FrameF)Target frame.
factor (double)Interpolation factor.
Interpolated frame.

IsVisible

#
public bool IsVisible(Point2d point)
Gets whether a point in content coordinates is visible within the boundary rectangle.
point (Point2d)

Limit

#
public FrameF Limit((double x0, double x1, double y0, double y1) soft, (double x0, double x1, double y0, double y1) hard)
Create a frame which does not exceed the maximum zoom levels in all directions.
soft ((double x0, double x1, double y0, double y1))Soft limits, up to this point no adjustment is taken.
hard ((double x0, double x1, double y0, double y1))Hard limits, guaranteed enforced limits on the projection.
Adjusted frame.

Normalise

#
public FrameF Normalise()
Normalise the horizontal and vertical zooming factors on this frame.

Pan

#
public FrameF Pan(PointF from, PointF to)
Perform a panning operation on this frame.
from (PointF)From point in boundary coordinates.
to (PointF)To point in boundary coordinates.
Modified frame.

ToBoundary

#
public PointF ToBoundary(Point2d contentPoint)
Map a point from content coordinates to boundary coordinates.
contentPoint (Point2d)

ToContent

#
public Point2d ToContent(PointF boundaryPoint)
Map a point from boundary coordinates to content coordinates.
boundaryPoint (PointF)

WithBoundary

#
public FrameF WithBoundary(RectangleF boundary)
Change the boundary on this frame.
boundary (RectangleF)New boundary.
Modified frame.

WithLimits

#
public FrameF WithLimits(double x0, double x1, double y0, double y1)
Change the limits on this frame.
x0 (double)
x1 (double)
y0 (double)
y1 (double)
Modified frame.

Zoom

#
public FrameF Zoom(PointF from, PointF to)
Perform a zoom operation on this frame.
from (PointF)Zoom start point in boundary coordinates.
to (PointF)Zoom end point in boundary coordinates.
Modified frame.