Projection

References
public class Projection
Immutable projection for an IControl.

Constructors

Projection

#
public Projection(PointF origin, float zoom)
Create a new projection.
origin (PointF)Origin of content in control coordinates.
zoom (float)Zoom level of content.

Properties

ContentPixelsPerControlPixel

#
public float ContentPixelsPerControlPixel { get; }
Gets the number of content pixels that fit inside a single control pixel.

ControlPixelsPerContentPixel

#
public float ControlPixelsPerContentPixel { get; }
Gets the number of control pixels that fit inside a single content pixel.

Origin

#
public PointF Origin { get; }
Gets the origin point.

TransformMatrix

#
public IMatrix TransformMatrix { get; }
Gets the transform matrix associated with this projection.

Zoom

#
public float Zoom { get; }
Gets the zoom factor.

ZoomInverse

#
public float ZoomInverse { get; }
Gets the reciprocal (one over) of the zoom factor.

Methods

CushionProjection

#
public Projection CushionProjection(IFlexControl control)
Cushion a projection so that the contents of a control are not moved too far outside the viewable region.
control (IFlexControl)Control to cushion.
Cushioned projection.

Interpolate

#
public static Projection Interpolate(Projection a, Projection b, float factor)
Interpolate between two projections.
a (Projection)
b (Projection)
factor (float)

PerformDollyZoom

#
public Projection PerformDollyZoom(PointF start, PointF end, float minimumZoom, float maximumZoom)
Zoom this projection while affecting the origin. Only the vertical motion matters and zooming always snaps to 100%.
start (PointF)Start of zoom in control coordinates.
end (PointF)End of zoom in control coordinates.
minimumZoom (float)Lowest allowable zoom factor.
maximumZoom (float)Highest allowable zoom factor.
Zoomed projection.

PerformDollyZoom

#
public Projection PerformDollyZoom(PointF start, PointF end)
Zoom this projection while affecting the origin. Only the vertical motion matters and zooming always snaps to 100%.
start (PointF)Start of zoom in control coordinates.
end (PointF)End of zoom in control coordinates.
Zoomed projection.

PerformPan

#
public Projection PerformPan(PointF start, PointF end)
Pan this projection.
start (PointF)Panning start in control coordinates.
end (PointF)Panning end in control coordinates.
Panned projection.

PerformPan

#
public Projection PerformPan(SizeF motion)
Pan this projection.
motion (SizeF)Panning motion vector in control coordinates.
Panned projection.

PerformZoom

#
public Projection PerformZoom(PointF start, PointF end, float minimumZoom, float maximumZoom)
Zoom this projection without affecting the origin. Only the vertical motion matters and zooming always snaps to 100%.
start (PointF)Start of zoom in control coordinates.
end (PointF)End of zoom in control coordinates.
minimumZoom (float)Lowest allowable zoom factor.
maximumZoom (float)Highest allowable zoom factor.
Zoomed projection.

PerformZoom

#
public Projection PerformZoom(PointF start, PointF end)
Zoom this projection without affecting the origin. Only the vertical motion matters and zooming always snaps to 100%.
start (PointF)Start of zoom in control coordinates.
end (PointF)End of zoom in control coordinates.
Zoomed projection.

SetCentre

#
public Projection SetCentre(PointF centre, RectangleF frame)
Create a new projection with the origin set such that a specific point is in the centre of the frame.
centre (PointF)Point in content coordinates to centre.
frame (RectangleF)Frame in control coordinates to centre in.
Modified projection.

SetFrame

#
public Projection SetFrame(RectangleF bounds, RectangleF focus, float minZoom, float maxZoom)
Create a new projection ensuring a content rectangle is fully visible within a framing rectangle.
bounds (RectangleF)Container frame in control coordinates.
focus (RectangleF)Rectangle in content coordinates to focus on.
minZoom (float)Minimum allowed zoom.
maxZoom (float)Maximum allowed zoom.
Modified projection.

SetOrigin

#
public Projection SetOrigin(PointF origin)
Create a new projection using a different origin.
origin (PointF)New origin.
Modified projection.

SetZoom

#
public Projection SetZoom(float zoom)
Create a new projection using a different zoom.
zoom (float)New zoom.
Modified projection.

Operators

OperationResultDescription
Projection*ProjectionProjectionMultiply two projections.