Click or drag to resize

DXFReaderNETControlPan Method

Pans the drawing of a distance indicated by the StartPoint-EndPoint segment.

Namespace:  DXFReaderNET
Assembly:  DXFReaderNET (in DXFReaderNET.dll) Version: 20.10.54
Syntax
public void Pan(
	Vector2 StartPoint,
	Vector2 EndPoint
)

Parameters

StartPoint
Type: DXFReaderNETVector2
The start point of the pan distance.
EndPoint
Type: DXFReaderNETVector2
The end point of the pan distance.
Examples
How to use the Pan method to move the drawing simply clicking with the middle button and moving the mouse:
[C#]
private Vector2 panPointStart = Vector2.Zero;

private void dxfReaderNETControl1_MouseDown(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Middle)
    {
        dxfReaderNETControl1.Cursor = Cursors.Hand;
        panPointStart = dxfReaderNETControl1.CurrentWCSpoint;
    }
}

private void dxfReaderNETControl1_MouseMove(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Middle)
        dxfReaderNETControl1.Pan(dxfReaderNETControl1.CurrentWCSpoint, panPointStart);
}

private void dxfReaderNETControl1_MouseUp(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Middle)
        dxfReaderNETControl1.CustomCursor = CustomCursorType.CrossHair;

}
[Visual Basic]
Private panPointStart As Vector2 = Vector2.Zero

Private Sub dxfReaderNETControl1_MouseDown(sender As Object, e As MouseEventArgs) Handles dxfReaderNETControl1.MouseDown
    If e.Button = MouseButtons.Middle Then
        dxfReaderNETControl1.Cursor = Cursors.Hand
        panPointStart = dxfReaderNETControl1.CurrentWCSpoint
    End If
End Sub

Private Sub dxfReaderNETControl1_MouseMove(sender As Object, e As MouseEventArgs) Handles dxfReaderNETControl1.MouseMove
    If e.Button = MouseButtons.Middle Then dxfReaderNETControl1.Pan(dxfReaderNETControl1.CurrentWCSpoint, panPointStart)
End Sub

Private Sub dxfReaderNETControl1_MouseUp(sender As Object, e As MouseEventArgs) Handles dxfReaderNETControl1.MouseUp
    If e.Button = MouseButtons.Middle Then dxfReaderNETControl1.CustomCursor = CustomCursorType.CrossHair
End Sub
See Also