Constructors
Fields
Properties
ControlMidPoint
#Gets the point in the exact center of the viewport in control coordinates.
public PointF ControlMidPoint { get; }
Height
#Gets or sets the height of the viewport. Typically this is tied to the dimensions of the canvas. Height is not allowed to go below 5 pixels.
MidPoint
#Gets or sets the canvas coordinate that is directly underneath the center of the viewport.
public PointF MidPoint { get; set; }
ScreenPort
#Gets the dimensions of the viewport in control coordinates.
public Rectangle ScreenPort { get; }
Size
#Gets or sets the size of the viewport. The size is typically tied to the dimensions of the Canvas.
public Size Size { get; set; }
Target
#Gets or sets the location of the target pixel. The target represents where the canvas origin is drawn.
public Point Target { get; set; }
TargetRatio
#Gets or sets the target ratio with respect to the viewport dimensions. This is a useful tool to prevent weird view changes during a canvas resize.
public SizeF TargetRatio { get; set; }
Tx
#Gets or sets the x-component of the target pixel. The target represents where the canvas origin is drawn.
Ty
#Gets or sets the y-component of the target pixel. The target represents where the canvas origin is drawn.
Width
#Gets or sets the width of the viewport. Typically this is tied to the dimensions of the canvas. Width is not allowed to go below 5 pixels.
Methods
DollyZoom
#Advanced interface function for mouse 'dolly' zooming.
Returns: True if a change to the viewport was made, otherwise false.
Duplicate
#IsVisible
#Test visibility of a point.
Returns: True if the point is visible in the control upon projection.
IsVisible
#Test visibility of a rectangle.
public bool IsVisible()
Returns: True if the rectangle is visible in the control upon projection.
LimitUnit
#Utility function for calculating pixel dimensions in a zoom-aware environment. The desired value is put through the zoom projection and if the resulting size (as displayed on the screen) exceeds the visual limits it is clipped. This function can be used for example to make sure that a certain penwidth never exceeds visual limits (i.e. it doesn't get too thin or too thick on the screen).
Project
#Transform a point from canvas into control coordinate space.
public void Project()
ref PointF
pt
Point to transform.
ProjectPoint
#Project a point from canvas coordinates into control coordinates.
public PointF ProjectPoint()
PointF
pt
The point in canvas coordinates.
Returns: The associated point in control pixel coordinates.
ProjectRectangle
#Project a rectangle from canvas coordinates into control coordinates.
Returns: The associated rectangle in control pixel coordinates.
ProjectX
#Project a value along constant X from canvas coordinates into control coordinates.
Returns: The associated X value in control pixel coordinates.
ProjectY
#Project a value along constant Y from canvas coordinates into control coordinates.
Returns: The associated Y value in control pixel coordinates.
Set
#SolveUnit
#Utility function for calculating graphics dimensions in a zoom-aware environment. This function can be used for example to compute the linewidth of a pen which always needs to appear as 3 pixels thick on the screen regardless of zoom values.
Unproject
#Transform a point from control into canvas coordinate space.
public void Unproject()
ref PointF
pt
Point to transform.
UnprojectPoint
#Project a point from control coordinates into canvas coordinates.
public PointF UnprojectPoint()
PointF
pt
The point in control coordinates.
Returns: The associated point in canvas coordinates.
UnprojectRectangle
#Project a rectangle from control coordinates into canvas coordinates.
Returns: The associated rectangle in canvas coordinates.
UnprojectX
#Project a value along constant X from control coordinates into canvas coordinates.
Returns: The associated X value in canvas coordinates.
UnprojectY
#Project a value along constant Y from control coordinates into canvas coordinates.
Returns: The associated Y value in canvas coordinates.