Retrieves the bounding rectangle for a specific item within the RasterImageList control.
public Rectangle GetItemRectangle(
Leadtools.Winforms.RasterImageListItem item
)
Public Function GetItemRectangle( _
ByVal item As Leadtools.Winforms.RasterImageListItem _
) As Rectangle
public:
Rectangle GetItemRectangle(
Leadtools.Winforms.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.
Imports Leadtools.WinForms
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Drawing
Public Sub RasterImageList_GetItemRectangle(ByVal imageList As RasterImageList)
' Loop through all items
For Each item As RasterImageListItem In imageList.Items
' Get the item bounding rectangle
Dim rc As Rectangle = imageList.GetItemRectangle(item)
' If this rectangle is visible, highlight it
If imageList.ClientRectangle.IntersectsWith(rc) Then
' Convert the rectangle to screen coordinates
rc = imageList.RectangleToScreen(rc)
ControlPaint.DrawReversibleFrame(rc, Color.Transparent, FrameStyle.Thick)
End If
Next item
End Sub
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);
}
}
}
Products |
Support |
Feedback: GetItemRectangle Method (RasterImageList) - Leadtools.WinForms |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.