GH_NamedView

References
Named views are used both to store named views but also to allow smooth programmatic canvas navigation.

Constructors

GH_NamedView

#
Create a default named view.
public GH_NamedView()

GH_NamedView

#
Create a new view useful for point match transitions.
public GH_NamedView(
view,
Viewport this transition is supposed to work in.
Point
point,
Point in control coordinates that is supposed to be matched.
PointF
target
Point in canvas coordinates that will be matched.
)

GH_NamedView

#
Create a new view useful for point inclusion transitions.
public GH_NamedView(
view,
Viewport this transition is supposed to work in.
Rectangle
region,
Region into which the target is supposed to be visible in control coordinates. For example, the contents of the viewport.
PointF
target
Point to ensure.
)

GH_NamedView

#
Create a new view useful for box-fit transitions.
public GH_NamedView(
Rectangle
view_box,
The dimensions of the area into which we want to display something in control coordinates. For example, the Visible area in a Viewport.
target_box
The dimensions of the area we want to display in viewport coordinates. For example, the bounding box of some objects.
)

GH_NamedView

#
Create a new named view.
public GH_NamedView(
view_name,
Name of view.
PointF
view_point,
Anchor point of named view.
view_zoom = 1,
Zoom factor of named view.
view_type = GH_NamedViewType.target
The type of named view.
)

Properties

Name

#
Gets or sets the name of the view.
public string Name { get; set; }

Point

#
Gets or sets the anchor point of the named view.
public PointF Point { get; set; }

Type

#
Gets or sets a value indicating whether the anchor point represents the target or the center.
public GH_NamedViewType Type { get; set; }

Zoom

#
Gets or sets the zoom factor of the named view.
public float Zoom { get; set; }

Methods

LoadFromViewport

#
Create a named view from a viewport.
public void LoadFromViewport(
vp,
Viewport to mimic.
view_type
Type of named view to create.
)

Read

#
public bool Read(
reader
)
Read

SetToViewport

#
Animates a view transition.
public void SetToViewport(
cv,
Canvas to apply the transition to.
length
Length (in milliseconds) of the transition.
)

SetToViewport

#
Set the named view to the canvas viewport and redraw the canvas.
public void SetToViewport(
cv
Canvas to set
)

SetToViewport

#
Set the named view to a viewport.
public void SetToViewport(
vp
Viewport to set.
)

Write

#
public bool Write(
writer
)
Write

Events

SmoothFrame

#
This event is raised during smooth animations.
public event GH_NamedView.SmoothFrameEventHandler SmoothFrame