ImageDisplay

A class that defines display properties for images.

Property

Type

Description

ImageDPI

double

The number of pixels per inch. Used to calculate scale on the server.

ImageHeight

int

The height of the image in pixels.

ImageWidth

int

The width of the image in pixels.

TransparentColor

Color

A color to render transparent in the image.

Remarks

The Image Display object contains the display characteristics of the image to be generated. These characteristics include the height and width of the image in pixels (ImageHeight and ImageWidth), the device resolution, in dots per inch of the image (ImageDPI) and the transparent color (TransparentColor).

Use TransparentColor to make a specified color transparent. This is most commonly done to make the background transparent. This can be performed on any MapServer function that takes an ImageDisplay as a parameter. Setting a transparent color is valid only for formats that support transparency. These include: png, png24 and gif. When using ExportMapImage if different colors are set as transparent in the TransparentColor property of the MapDescription and in the ImageDisplay, the color set in the ImageDisplay takes precedence over the one set in the MapDescription.

To make background of the image transparent set the ImageDisplay TransparentColor equal to the BackgroundColor property specified in MapServerInfo.

2/28/2020