Mapscript image object creation.

Mark Wright sparkymeister at GMAIL.COM
Wed Dec 14 20:40:58 EST 2005


In the map img tag set the src attribute to a php file with a
querystring stating everything needed to get the correct map and
settings. When it's time to save the generated image do the following:

header('Content-type: image/png');
$image->saveImage('');

This will send the image to the browser instead of saving it to disk
and set the proper mime type so that the browser knows it is receiving
image data. If you are generating an image in a format other than png
simply change the content-type to match.


Mark

On 12/14/05, Paul Moen <pmoen at state.nd.us> wrote:
> Does anyone know how to take an ImageObj in Mapscript and send the output to a variable in PHP
> rather than to standard out or a disk file?
>
> I am looking for something like $imageVar = $imgOb->saveImage('');
>


--
Have fun or die trying - but try not to actually die.
http://www.AboveCalifornia.com
Got Mac OS X? Get the AboveCalifornia Sherlock Channel:
sherlock://www.AboveCalifornia.com/sherlock/SherlockChannel.xml?action=add



More information about the mapserver-users mailing list