IMapView.GetImage

Syntax

GetImage(Metafile: Boolean; Width: Integer; Height: Integer): IGxImage;

Parameters

Metafile - the attribute indicating that the image returned must be in metafile format.

Width - the width of the returned image.

Height - the height of the returned image.

Description

The GetImage method returns graphic presentation of the specified map area and the objects located on it.

Example

Executing the example requires a form with the Button1 button, the MapBox component and the UiMap component that is a data source for MapBox.

The example is executed on clicking the button.

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

Var

Map: IMap;

MapView: IMapView;

Image: IGxImage;

Begin

Map := UiMap1.Map;

MapView := Map.View;

Image := MapView.GetImage(True, MapBox1.Width, MapBox1.Height);

Image.SaveToFile("C:\Map.bmp");

End Sub Button1OnClick;

After executing the example all the area of the map is saved as an image to the "C:\Map.bmp" file.

See also:

IMapView