c# imageObj.save method not working properly?

Paolo Corti pcorti at GMAIL.COM
Wed Oct 25 05:16:01 EDT 2006


Thank you Tamas
that made the trick

after setting mapObj.mappath the images are saved in the correct folder

even if i don't understand what is connected with mapObj.mappath (the
mapfile location) and the image location, that should be set according to
imageObj.imagepath (=IMAGEPATH value in the WEB parameter in map file)

public override String GetURLMap()
    {
      //refresh map
      imageObj image = map.draw();
      //be sure to have set Web parameters in mapfile (IMAGEPATH, IMAGEURL)
      //explicitily set mappath
      map.mappath = image.imagepath;
      //return URLMap
      String time = DateTime.Now.Hour.ToString() +
DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() +
DateTime.Now.Millisecond.ToString();
      String ImageName = time + "." + map.outputformat.extension;
      //image.save(image.imagepath + "\\" + ImageName, map);
      image.save(ImageName, map);
      return image.imageurl + "/" + ImageName;
    }

best regards
Paolo


Tamas Szekeres wrote:
> 
> Hi Paolo,
> 
> You might have to explicitly set the mapObj.path property after loading
> the map.
> 
> Best Regards,
> 
> Tamas
> 
> 
> 2006/10/24, Paolo Corti <pcorti at gmail.com>:
>>  Hello all Looks like the imageObj.save(filename) metod doesn't work
>> properly I correctly set IMAGEPATH and IMAGEURL in mapfile: WEB IMAGEPATH
>> "C:/Inetpub/wwwroot/output" IMAGEURL "http://localhost/output" END If I
>> try
>> to write the image to disk with imageObj.save(filename) the image is not
>> saved in the IMAGEPATH location, but in the mapfile's folder. For example
>> if
>> I save the image: imageObj.save("test.jpg") The image test.jpg is not
>> written under IMAGEPATH("C:/Inetpub/wwwroot/output") but in
>> the mapfile folder (another folder). The workaround is to give the
>> fullname
>> of image, like here: public override String GetURLMap() { //refresh map
>> imageObj image = map.draw(); //be sure to have set Web parameters in
>> mapfile
>> (IMAGEPATH, IMAGEURL) //return URLMap String ImageName =
>> DateTime.Now.Second.ToString() +
>> DateTime.Now.Millisecond.ToString() + "." +
>> map.outputformat.extension; image.save(image.imagepath + "\\" +
>> ImageName,
>> map); //image.save(ImageName, map); return image.imageurl + "/" +
>> ImageName;
>> } but I am wondering how no one still pointed out this bug, maybe I
>> configured something wrong in map file. Any help appreciated Paolo Corti
>> http://www.paolocorti.net
>> ________________________________
>>  View this message in context: c# imageObj.save method not working
>> properly?
>>  Sent from the Mapserver - User mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/c--imageObj.save-method-not-working-properly--tf2501170.html#a6988662
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list