imageObj
final class imageObj (View source)
Instances of imageObj are always created by the mapObj
_ class methods.
Properties
int | $width | read-only | |
int | $height | read-only | |
int | $resolution | read-only | |
int | $resolutionfactor | read-only | |
string | $imagepath | ||
string | $imageurl |
Methods
Copy srcImg on top of the current imageObj.
Writes image to temp directory. Returns image URL.
Details
final void
pasteImage(imageObj $srcImg, int $transparentColorHex, int $dstX, int $dstY, int $angle)
Copy srcImg on top of the current imageObj.
transparentColorHex is the color (in 0xrrggbb format) from srcImg that should be considered transparent (i.e. those pixels won't be copied). Pass -1 if you don't want any transparent color. If optional dstx,dsty are provided then it defines the position where the image should be copied (dstx,dsty = top-left corner position). The optional angle is a value between 0 and 360 degrees to rotate the source image counterclockwise. Note that if an angle is specified (even if its value is zero) then the dstx and dsty coordinates specify the CENTER of the destination area. Note: this function works only with 8 bits GD images (PNG or GIF).
final int
saveImage(string $filename, mapObj $oMap)
Writes image object to specified filename.
Passing no filename or an empty filename sends output to stdout. In this case, the PHP header() function should be used to set the document's content-type prior to calling saveImage(). The output format is the one that is currently selected in the map file. The second argument oMap is not manadatory. It is usful when saving to formats like GTIFF that needs georeference information contained in the map file. On success, it returns either MS_SUCCESS if writing to an external file, or the number of bytes written if output is sent to stdout.
final string
saveWebImage()
Writes image to temp directory. Returns image URL.
The output format is the one that is currently selected in the map file.