- class mapscript.imageObj(*args)¶
An image object is a wrapper for images generated by MapServer.
int immutable image height in pixels
double immutable image resolution in pixels per inch
double immutable resolution factor
The membership flag
int immutable image width in pixels
Create a new
imageObjinstance. If filename is specified, an imageObj is created from the file and any specified width, height, and format parameters will be overridden by values of the image in filename. Otherwise, if format is specified (as an
outputFormatObj) an imageObj is created using that format. If filename is not specified, then width and height should be specified. The default resolution is currently 72 and defined by
MS_DEFAULT_RESOLUTION- this setting is not available in MapScript.
- getBytes() gdBuffer ¶
Returns the image contents as a binary buffer. The exact form of this buffer will vary by MapScript language (e.g. a string in Python, byte array in Java and C#, unhandled in Perl)
- getSize() int ¶
Returns the size of the binary buffer representing the image buffer
The getSize method is inefficient as it does a call to getBytes and then computes the size of the byte array. The byte array is then immediately discarded. In most cases it is more efficient to call getBytes directly.
- save(filename: char, map: mapObj = None) void ¶
Save image to filename. The optional map parameter must be specified if saving GeoTIFF images.
- write(*args) int ¶
Write image data to an open file handle. Replaces the removed saveToString function. See
python/pyextend.ifor the Python specific version of this method.