Retrieves the bounding rectangle for a specific item within the RasterImageList control.
public Rectangle GetItemRectangle(
RasterImageListItem item
)
public:
Rectangle GetItemRectangle(
RasterImageListItem^ item
)
public:
Rectangle^ GetItemRectangle(
RasterImageListItem^ item
)
item
The item within the RasterImageList whose bounding rectangle you want to retrieve.
A System.Drawing.Rectangle that represents the bounding rectangle of the specified RasterImageListItem.
The bounding rectangle returned by this method represents the entire item.
The bounding rectangle that this method returns could contain a negative position or could be outside the client rectangle of the control. The exact position of the item depends on the current size of the control as well as the current scroll position.
This example will highlight the position of all visible items a RasterImageList control.
using Leadtools.WinForms;
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Drawing;
public void RasterImageList_GetItemRectangle(RasterImageList imageList)
{
// Loop through all items
foreach (RasterImageListItem item in imageList.Items)
{
// Get the item bounding rectangle
Rectangle rc = imageList.GetItemRectangle(item);
// If this rectangle is visible, highlight it
if (imageList.ClientRectangle.IntersectsWith(rc))
{
// Convert the rectangle to screen coordinates
rc = imageList.RectangleToScreen(rc);
ControlPaint.DrawReversibleFrame(rc, Color.Transparent, FrameStyle.Thick);
}
}
}
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