Gets or sets a user-defined image to use as the selection marker.
[BrowsableAttribute(false)]
public Leadtools.RasterImage SelectUserImage {get; set;}
<BrowsableAttribute(False)>
Public Property SelectUserImage As Leadtools.RasterImage
[BrowsableAttribute(false)]
public:
property Leadtools.RasterImage^ SelectUserImage {
Leadtools.RasterImage^ get();
void set ( Leadtools.RasterImage^ );
}
A user-defined Leadtools.RasterImage to use as the selection marker. Default value is null (Nothing in VB).
The user defined image selection marker is used only when ViewStyle is set to RasterImageListViewStyle.Normal. It is ignored in all other styles.
When you set an image into the SelectUserImage, the specified image will be displayed around each selected item.
Normally, you would want to set a transparent color into this image using the RasterImage.Transparent and RasterImage.TransparentColor properties of the Leadtools.RasterImage class.
Imports Leadtools.WinForms
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Drawing
''' This example will use a user-defined image as the selection marker for a <see cref="RasterImageList"/> control.
Public Sub RasterImageList_SelectUserImage(ByVal imageList As RasterImageList)
imageList.ViewStyle = RasterImageListViewStyle.Normal
' Create the user-defined image to use as the selection marker (an ellipse)
Dim palette As RasterColor() = New RasterColor() {}
Dim selectImage As RasterImage = New RasterImage(RasterMemoryFlags.Conventional, imageList.ItemSize.Width, imageList.ItemSize.Height, 24, _
RasterByteOrder.Bgr, RasterViewPerspective.TopLeft, palette, IntPtr.Zero, 0)
' Draw the ellipse
Dim hdc As IntPtr = RasterImagePainter.CreateLeadDC(selectImage)
Dim g As Graphics = Graphics.FromHdc(hdc)
Dim rc As Rectangle = New Rectangle(0, 0, selectImage.ImageWidth, selectImage.ImageHeight)
g.FillRectangle(Brushes.Black, rc)
For i As Integer = 0 To 3
g.DrawEllipse(Pens.Red, rc.Left, rc.Top, rc.Width - 1, rc.Height - 1)
rc.Inflate(-1, -1)
Next i
g.Dispose()
RasterImagePainter.DeleteLeadDC(hdc)
' Set the transparent color
selectImage.Transparent = True
selectImage.TransparentColor = RasterColor.FromKnownColor(RasterKnownColor.Black)
' Set this image as the selection marker
imageList.SelectUserImage = selectImage
End Sub
using Leadtools.WinForms;
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Drawing;
/// This example will use a user-defined image as the selection marker of an <see cref="RasterImageList"/> control.
public void RasterImageList_SelectUserImage(RasterImageList imageList)
{ // Use "Normal" view style
imageList.ViewStyle = RasterImageListViewStyle.Normal;
// Create the user-defined image to use as the selection marker (an ellipse)
RasterColor[] palette = new RasterColor[0];
RasterImage selectImage = new RasterImage(
RasterMemoryFlags.Conventional,
imageList.ItemSize.Width,
imageList.ItemSize.Height,
24,
RasterByteOrder.Bgr,
RasterViewPerspective.TopLeft,
palette,
IntPtr.Zero,
0);
// Draw the ellipse
IntPtr hdc = RasterImagePainter.CreateLeadDC(selectImage);
Graphics g = Graphics.FromHdc(hdc);
Rectangle rc = new Rectangle(0, 0, selectImage.ImageWidth, selectImage.ImageHeight);
g.FillRectangle(Brushes.Black, rc);
for(int i = 0; i < 4; i++)
{
g.DrawEllipse(Pens.Red, rc.Left, rc.Top, rc.Width - 1, rc.Height - 1);
rc.Inflate(-1, -1);
}
g.Dispose();
RasterImagePainter.DeleteLeadDC(hdc);
// Set the transparent color
selectImage.Transparent = true;
selectImage.TransparentColor = RasterColor.FromKnownColor(RasterKnownColor.Black);
// Set this image as the selection marker
imageList.SelectUserImage = selectImage;
}
Products |
Support |
Feedback: SelectUserImage Property (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.