ImageGear .NET - Updated
ImGearPan Class
Members  Example 




ImageGear24.Windows.Forms Assembly > ImageGear.Windows.Forms Namespace : ImGearPan Class
This is the GUI Pan Control that allows the visible portion of an image displayed in the ImGearPageView class control to be moved by dragging the mouse around in the image.
Object Model
ImGearPan ClassImGearPageView ClassImGearPageView Class
Syntax
'Declaration
 
Public Class ImGearPan 
   Inherits System.ComponentModel.Component
'Usage
 
Dim instance As ImGearPan
public class ImGearPan : System.ComponentModel.Component 
public __gc class ImGearPan : public System.ComponentModel.Component 
public ref class ImGearPan : public System.ComponentModel.Component 
Remarks

The common task for drawing an image in the ImGearPageView control is panning an image inside the window using mouse capturing. This class provides such functionality. This is not a Window or Control; this is a Component that extends the functionality of ImGearPageView with a panning algorithm. Assign the ImGearPageView control to the ImGearPan component to implement the panning functionality in page view. Use the SourceViewCursor property to change the dragging cursor in the source view of the ImGearPan component. Change the mouse button used for dragging with the PanButton property.

Optionally, a floating window can be used to display the complete image, scaled to fit within the floating window. By dragging the mouse within this floating window, the image in the ImGearPageView class control is repositioned. The portion of the image that is visible in the ImGearPageView class control is displayed within the floating window in reverse video. Assign the ImGearPageView control that will illustrate the place of the source view on the image to the DestinationView property of the ImGearPan component.

Example
This example illustrates how the ImGearPan component can be bound with two ImGearPageView controls to implemen the panning functionality. Created with the MainForm constructor of the application, the ImGearPan object is initialized with existing igPanSource and igPanDestination controls to achieve the required functionality. Since ImGearPan is a Component, working with ImGearPan is accessible from the Microsoft NET Windows Forms Designer.
using ImageGear.Core;
using ImageGear.Windows.Forms;
             
public partial class MainForm : Form
{
    // Panning implementation object.
    private ImGearPan igPan;
    
    // Creates the new application form.
    public MainForm()
    {
        InitializeComponent();
 
        // Create panning implementation object.
        igPan = new ImGearPan();
        // Assign source window for panning.
        igPan.SourceView = igPanSource;
        // Assign the navigation control.
        igPan.DestinationView = igPanDestination;
    }
}
Imports ImageGear.Core
Imports ImageGear.Windows.Forms
 
Public Partial Class MainForm
Inherits Form
' Panning implementation object.
Private igPan As ImGearPan
 
' Creates the new application form.
Public Sub New()
	InitializeComponent()
 
	' Create panning implementation object.
	igPan = New ImGearPan()
	' Assign source window for panning.
	igPan.SourceView = igPanSource
	' Assign the navigation control.
	igPan.DestinationView = igPanDestination
End Sub
End Class
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         ImageGear.Windows.Forms.ImGearPan

See Also

Reference

ImGearPan Members
ImageGear.Windows.Forms Namespace