Change the map size -- C# MapScript

Eduard Witteveen e.witteveen at HAWARIT.COM
Tue Jul 4 06:36:49 EDT 2006


Zhonghai Wang schreef:
> To get maps with different map size, I am trying to change the SIZE of the
> mapobject like this:
> 
> map.setSize(200,150), where map is a defined mapobject
First of all, i dont know if you are trying this for the first time, or 
you if you are trying to upgrade an application. I assume that you are 
doing the first.

I use the following code:
>                     mapObj map = new mapObj(mapfilename);
>                     map.setImageType(filetype);
>                     map.setSize(pbMapImage.Width, pbMapImage.Height);
>                     imageObj image = map.draw();
>                     image.save(imagefilename, map);
>                     pbMapImage.ImageLocation = imagefilename;

> but this seems not to work in my application.
> 
> I am using:
> 1. MS4W1.5.3 (directly downloaded from the web site. )
> 2. VS2005
> 
> no ideas what happened with the setSize().
You can look at my test-code at: http://nergens.org/projects/mapviewer/, 
the file Mapviewer.NET.2.0_1.1.zip contains a vs2005 project. I've had 
some trouble with using the correct version of mapserver 
(http://comments.gmane.org/gmane.comp.gis.mapserver.user/16866 )

Maybe this code can get you started (and help you test where things go 
wrong)

-- 
Ing. Eduard Yeb Witteveen           Software Engineer
Hawar Information Technology bv   lid Dijkoraad Groep
De Wymerts 7  8701 WT                        Bolsward
Tel: +31 (0)515 570333         Fax: +31 (0)515 570335
http://www.hawarit.com/             nl_NL fy_NL en_US



More information about the mapserver-users mailing list