Leadtools.WinForms Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
InteractiveScale Event
See Also  Example
Leadtools.WinForms Namespace > RasterImageViewer Class : InteractiveScale Event



Occurs when the user performs interactive change of the current scale factor using the mouse.

Syntax

Visual Basic (Declaration) 
Public Event InteractiveScale() As EventHandler(Of RasterViewerLineEventArgs)
Visual Basic (Usage)Copy Code
Dim instance As RasterImageViewer
Dim handler As EventHandler(Of RasterViewerLineEventArgs)
 
AddHandler instance.InteractiveScale, handler
C# 
public event EventHandler<RasterViewerLineEventArgs> InteractiveScale()
C++/CLI 
public:
event EventHandler<RasterViewerLineEventArgs>^ InteractiveScale();

Example

This sample lets you drag the mouse to scale an image. Also, it displays the contents of the InteractiveScale event in the console

Visual BasicCopy Code
Private Sub viewer_InteractiveScale(ByVal sender As Object, ByVal e As RasterViewerLineEventArgs)
    Dim viewer As RasterImageViewer = CType(IIf(TypeOf sender Is RasterImageViewer, sender, Nothing), RasterImageViewer)
    If e.Status = RasterViewerInteractiveStatus.Begin Then
        viewer.Cursor = Cursors.SizeAll
    ElseIf e.Status = RasterViewerInteractiveStatus.End Then
        viewer.Cursor = Cursors.Default
    End If
    Console.WriteLine("InteractiveScale: e.Begin {0}, e.End{1}, e.Status {2}, e.Cancel {3}", e.Begin, e.End, e.Status, e.Cancel)
End Sub
Public Sub RasterImageViewer_InteractiveScale(ByVal viewer As RasterImageViewer)
    viewer.InteractiveMode = RasterViewerInteractiveMode.Scale
    AddHandler viewer.InteractiveScale, AddressOf viewer_InteractiveScale

    ' Drag mouse across image to scale the image
    ' After you are done, you must remove the event handler as in below
    '
    ' viewer.InteractiveScale -= new EventHandler<RasterViewerLineEventArgs>(viewer_InteractiveScale);
End Sub
C#Copy Code
private void viewer_InteractiveScale(object sender, RasterViewerLineEventArgs e) 

   RasterImageViewer viewer = sender as RasterImageViewer; 
   if (e.Status == RasterViewerInteractiveStatus.Begin) 
      viewer.Cursor = Cursors.SizeAll; 
   else if (e.Status == RasterViewerInteractiveStatus.End) 
      viewer.Cursor = Cursors.Default; 
   Console.WriteLine("InteractiveScale: e.Begin {0}, e.End{1}, e.Status {2}, e.Cancel {3}", e.Begin, e.End, e.Status, e.Cancel); 

public void RasterImageViewer_InteractiveScale(RasterImageViewer viewer) 

   viewer.InteractiveMode = RasterViewerInteractiveMode.Scale; 
   viewer.InteractiveScale += new EventHandler<RasterViewerLineEventArgs>(viewer_InteractiveScale); 
 
   // Drag mouse across image to scale the image 
   // After you are done, you must remove the event handler as in below 
   // 
   // viewer.InteractiveScale -= new EventHandler<RasterViewerLineEventArgs>(viewer_InteractiveScale); 
}

Remarks

Only occurs when the RasterImageViewer.InteractiveMode property is set to RasterViewerInteractiveMode.Scale.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also