IMapImageVisual.Image

Syntax

Image: IMapVisualIconProperty;

Description

The property is read-only.

The Image property returns parameters of the factor icon.

Example

Executing the example requires a form, a button named Button1 on the form, the UiMap component named UiMap1 that is a data source for the MapBox component. The map must be connected to the UiMap1 component. The VisualDataAdapter class, that creates a dynamic data source, must also be implemented. The class example is contained in the IMapVisual.DataAdapter property description.The "C:\blue.gif" file, that contains the image, must be present in the file system.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

Map: IMap;

Layer: IMapLayer;

ImageVisual: IMapImageVisual;

Image: IGxImage;

Begin

Map := UiMap1.Map;

Layer := Map.Layers.FindByName("Regions");

ImageVisual := Layer.Visuals.AddImageVisual;

ImageVisual.DataAdapter := New VisualDataAdapter.Create As IMapDynamicDataAdapter;

Image := GxImage.FromFile("C:\blue.gif");

ImageVisual.Image.Value := Image;

ImageVisual.Height.Value := 4;

ImageVisual.Width.Value := 4;

End Sub Button1OnClick;

After executing the example the icon factor, that is 4 pixels long and wide, is added to the Regions layer.The factor icon is loaded from the C:\blue.gif file.

See also:

IMapImageVisual