Enables or disables rubber band selection in the RasterImageList.
public bool EnableRubberBandSelection { get; set; } public:property bool EnableRubberBandSelection{bool get()void set(bool value)}
true to enable rubber band selection; false otherwise. true is the default value.
This property is used only if SelectionMode is set to RasterImageListSelectionMode.Multi.
If this property value is set to true when bring up a context menu using right-click, the selection will be lost.
using Leadtools.WinForms;using Leadtools;using Leadtools.Codecs;using Leadtools.Drawing;class MyForm6 : Form{public RasterImageList imageList;RasterCodecs codecs;public MyForm6(){// Set the size of the formSize = new Size(500, 200);// Create a new RasterImageList controlimageList = new RasterImageList();imageList.Dock = DockStyle.Fill;imageList.SelectionMode = RasterImageListSelectionMode.Single;imageList.Size = Size;Controls.Add(imageList);imageList.BringToFront();codecs = new RasterCodecs();// Create three itemsstring imagesPath = LEAD_VARS.ImagesDir;for (int i = 0; i < 3; i++){// Load the imageint index = i + 1;string imageFileName = Path.Combine(imagesPath, @"ImageProcessingDemo\Image" + index.ToString() + ".cmp");RasterImage image = codecs.Load(imageFileName, 0, CodecsLoadByteOrder.BgrOrGray, 1, 1);RasterImageListItem item = new RasterImageListItem(image, 1, "Item" + index.ToString());// Select the first itemif (i == 0)item.Selected = true;// Add the item to the image listimageList.Items.Add(item);}// Add the RasterImageList to the control collection.Controls.Add(imageList);}}public void RasterImageList_AutoDeselectItems(){MyForm6 form = new MyForm6();// Enable rubber band multi selectform.imageList.EnableRubberBandSelection = true;// Enable the AutoDeselectItemsform.imageList.AutoDeselectItems = true;form.imageList.SelectionMode = RasterImageListSelectionMode.Multi;form.Text = "Drag mouse to select two images. Then single-click to de-select.";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
