windowsforms-devexpress-dot-xtramap-25f69275.md
An item that stores information about the color and description of the ColorLegendBase class descendants.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
public class ColorLegendItem :
MapLegendItemBase,
IColorLegendItem,
ILegendItem
Public Class ColorLegendItem
Inherits MapLegendItemBase
Implements IColorLegendItem,
ILegendItem
This example shows how to use images in a map legend.
The following symbols are used in the example:
|
|
Gets or sets the source of images to be displayed within a legend.
| |
|
Provides access to the collection of custom legend items.
| |
ColorLegendItem
|
An item that stores information about the color and description of the ColorLegendBase class descendants.
| |
|
Gets or sets the index of an image used by this legend item.
|
// In the Form's constructor.
//Create a Legend containing images.
ColorListLegend legend = new ColorListLegend();
legend.ImageList = map.ImageList;
legend.CustomItems.Add(
new ColorLegendItem {
ImageIndex = 0,
Text = "Shipwreck"
});
map.Legends.Add(legend);
' In the Form's constructor.
' Create a Legend containing images.
Dim legend As ColorListLegend = New ColorListLegend()
legend.ImageList = map.ImageList
legend.CustomItems.Add( _
New ColorLegendItem() With {
.ImageIndex = 0,
.Text = "Shipwreck"
})
map.Legends.Add(legend)
Object MapLegendItemBase ColorLegendItem
See Also