Occurs when the user performs a panning process for the RasterImagePanViewer displayed image.
public event EventHandler<RasterImagePanViewerEventArgs> Pan
public:
event EventHandler<RasterImagePanViewerEventArgs^>^ Pan
public:
event EventHandler<RasterImagePanViewerEventArgs^>^ Pan
The event handler receives an argument of type RasterImagePanViewerEventArgs containing data related to this event. The following RasterImagePanViewerEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel | Specifies whether or not to cancel the current panning process. |
Rectangle | The Pan Rectangle. |
Status | The Pan process current status. |
This event provides the current status of the pan operation: Begin, Panning, or End, as well the current panning rectangle.
using Leadtools.WinForms;
using Leadtools;
using Leadtools.Codecs;
class MyForm1 : Form
{
public RasterImagePanViewer panViewer;
public RasterImageViewer viewer;
public MyForm1(string title)
{
Text = title;
// Set the size of the form
Size = new Size(400, 400);
// Create the viewer
viewer = new RasterImageViewer();
viewer.Size = new Size(Size.Width, Size.Height / 2);
viewer.Dock = DockStyle.Fill;
// Load an image
RasterCodecs codecs = new RasterCodecs();
viewer.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "image1.cmp"));
panViewer = new RasterImagePanViewer();
panViewer.Dock = DockStyle.Top;
panViewer.BackColor = Color.Bisque;
panViewer.ClipCursor = true;
panViewer.BorderStyle = BorderStyle.Fixed3D;
panViewer.BringToFront();
panViewer.Pan += new EventHandler<RasterImagePanViewerEventArgs>(panViewer_Pan);
panViewer.RectangleColor = Color.Blue;
panViewer.ImageColor = Color.FromArgb(128, 0, 0, 0);
panViewer.Cursor = Cursors.Hand;
panViewer.Viewer = viewer;
Controls.Add(panViewer);
Controls.Add(viewer);
viewer.BringToFront();
}
private void panViewer_Pan(object sender, RasterImagePanViewerEventArgs e)
{
switch (e.Status)
{
case RasterImagePanViewerStatus.Begin:
case RasterImagePanViewerStatus.Panning:
case RasterImagePanViewerStatus.End:
{
Text = "Pan Status = " + e.Status.ToString() + " Rectangle =" + e.Rectangle.ToString() + " Cancel = " + e.Cancel.ToString();
Console.WriteLine(Text);
break;
}
}
}
}
public void RasterImagePanViewer_Viewer()
{
MyForm1 form = new MyForm1("Test_RasterImagePanViewer_Viewer");
form.ShowDialog();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document