Selects or un-selects all the items in this RasterImageList control.
public void SelectAll(bool select)
public:void SelectAll(bool select)
select
true to select all items, false to un-select all items.
The RasterImageList.SelectedIndexChanged event will occur if the value of the RasterImageListItem.Selected property of any item inside the control changes as a result of calling this method.
using Leadtools.WinForms;using Leadtools;using Leadtools.Codecs;using Leadtools.Drawing;class MyForm5 : Form{RasterImageList imageList;RasterCodecs codecs;public MyForm5(string title){Text = title;// Set the size of the formSize = new Size(400, 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);}// Use manual selectionimageList.SelectionMode = RasterImageListSelectionMode.None;// Add a handler to the MouseDown eventimageList.MouseDown += new MouseEventHandler(rasterImageList_MouseDown);// Add the RasterImageList to the control collection.Controls.Add(imageList);}private void rasterImageList_MouseDown(object sender, MouseEventArgs e){RasterImageList imageList = sender as RasterImageList;// Check if we are in manual selection mode and if this is a left button clickif (imageList.SelectionMode == RasterImageListSelectionMode.None &&e.Button == MouseButtons.Left){// Yes, get the item under the cursor positionRasterImageListItem item = imageList.HitTest(e.X, e.Y);// If not already selected, select this itemif (item != null && !item.Selected){imageList.BeginUpdate();// First, de-select any itemsimageList.SelectAll(false);// Now select this itemitem.Selected = true;imageList.EndUpdate();item.Invalidate();}}}}public void RasterImageList_SelectionMode(string title){MyForm5 form = new MyForm5(title);form.ShowDialog();}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";}
RasterThumbnailBrowser Members
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
