←Select platform

IdleCursor Property

Summary

Mouse cursor to use for the idle state of this ImageViewerInteractiveMode.

Syntax
C#
C++/CLI
public virtual Cursor IdleCursor { get; set; } 
public:  
   virtual property System::Windows::Forms::Cursor^ IdleCursor 
   { 
      System::Windows::Forms::Cursor^ get() 
      void set(System::Windows::Forms::Cursor^ value) 
   } 

Property Value

The mouse cursor to use for the idle state of this ImageViewerInteractiveMode. The default value is null.

Remarks

IdleCursor and WorkingCursor are only used when this ImageViewerInteractiveMode is attached to the left mouse button and is enabled. It will not be used if this mode is attached to any other button.

The cursors are set into the ImageViewer control when this interactive mode is assigned to the left mouse button. Also, the cursors will be set in any elements added by the user to the InteractiveService.UserControls collection.

IdleCursor will be set when the interactive mode is started (after Start is called) and removed when the mode is stopped (when Stop is called).

WorkingCursor will be set when the interactive mode is working (When OnWorkStarted is called) and removed (or set back to idle) when the interactive mode has stopped working (When OnWorkCompleted) is called).

These cursors can be used to provide a visual clue into the current interactive mode operations. For instance, when using the ImageViewerPanZoomInteractiveMode interactive mode, you can set IdleCursor to "crosshair" and WorkingCursor to "move".

Example
C#
using Leadtools; 
using Leadtools.Controls; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
 
public ImageViewerForm _form = new ImageViewerForm(); 
public ImageViewer _imageViewer; 
 
public void ImageViewerInteractiveModeCursorsExample() 
{ 
   // Get the Form's ImageViewer control 
   _imageViewer = _form.ImageViewer; 
 
   // Load Image 
   using (var codecs = new RasterCodecs()) 
      _imageViewer.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.tif")); 
 
   // Add PanZoom interactive mode with a hand cursor when working (panning) 
   _imageViewer.InteractiveModes.BeginUpdate(); 
   ImageViewerPanZoomInteractiveMode panZoom = new ImageViewerPanZoomInteractiveMode { IsEnabled = true }; 
   _imageViewer.InteractiveModes.Add(panZoom); 
   panZoom.IdleCursor = Cursors.Cross; 
   panZoom.WorkingCursor = Cursors.Hand; 
   _imageViewer.InteractiveModes.EndUpdate(); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.