Maptitude GISDK Help

SaveMapToImage()

Summary

Saves the contents of the map window to an image file.

 

Changes

Resolution, Alpha Channels, and Opacity options added to Version 5.0. TIFF and GIF image types added to Version 6.0/2012.

 

Syntax

SaveMapToImage(string map_name, string file_name, string type, array options)

 

Argument Contents
map_name The map to be saved, or null for the current map
file_name The path and file name of the image file to be created
type Type of image file: "JPEG", "BITMAP", "TIFF", "GIF", or "PNG" (not case sensitive)

 

Option Type Contents
Resolution Integer The number of dots per inch to use in the output. The default is the map window resolution.
Quality Integer Quality of the JPEG image. The higher the quality setting, the larger the resulting JPEG files. The default quality is 75.
Alpha Channels Array An array of two element subarrays, each of which must be a {macro_color, opacity_level} pair (PNG images only)
Opacity Integer The opacity level (from 255=completely opaque to 0=completely transparent) for all colors not specified in the Alpha Channel option (PNG images only)

 

Notes

Examples

SaveMapToImage("My Map", "c:\\images\\map1.jpg", "JPEG", {{"Quality", 70}} )

 

// Make white background of PNG be clear and rest of colors be about 80% opaque

background_color = ColorRGB(65535, 65535, 65535)

SaveMapToImage("My Map", "c:\\images\\map2.png", "PNG", {{"Opacity", 200}, {"Alpha Channels",{{background_color,0}}}} )

 

Error Codes

Error Type Meaning
Error Error writing to disk (e.g., out of disk space)
NotFound The specified map does not exist

 

See Also

Function Summary
SaveEditorToImage() Saves the contents of the editor window to an image file
SaveFigureToImage() Saves the contents of the figure window to an image file
SaveLayoutToImage() Saves the contents of the layout window to an image file
SaveLegendToImage() Saves a legend in a separate window to an image file

 

 

©2025 Caliper Corporation www.caliper.com