[mapguide-users] Overriding DPI

simon hope simonh at geobiz.co.nz
Thu Sep 6 18:59:30 EDT 2007


Hi,

I'm trying a number of methods for exporting images:

1. I used the MgRenderingService class to produce an image (had to use a
nasty hack to get the current extent as map.GetDataExtent(); doesn't seem to
work?), but using this method does not give me any control over the image
dpi.

2. I then sent a request over HTTP directly to the MapAgent CGI - this gives
me the flexibilty to pass parameters over the URL, however when I set
different DPI values, I always get an image set at 72 dpi. Here is a sample
of the request:

http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=GETMAPIMAGE&VERSION=1.0.0&SESSION=6669fbe4-0000-1000-8000-0013d3c0f8fe_en_C0A801140AFC0AFB0AFA&MAPNAME=Sheboygan&LOCALE=en&FORMAT=PNG&SETVIEWCENTERX=-87.732492&SETVIEWCENTERY=43.743934&SETVIEWSCALE=5000&SETDISPLAYDPI=96&SETDISPLAYWIDTH=1024&SETDISPLAYHEIGHT=768

This URL uses 96 DPI - if i sent the same URL but increased the DPI, this
has the effect of changing the extent of the actual image, despite keeping
the other parameters static.

I read on a post that DPI can be overriden "if the session allows it"? Does
this mean that I have to update the session somewhere?

I have attached three images using different DPI values (96, 300 and 600)
which illustrates the effect.

http://www.nabble.com/file/p12533054/http_request96.png http_request96.png 
http://www.nabble.com/file/p12533054/http_request300.png http_request300.png 
http://www.nabble.com/file/p12533054/http_request600.png http_request600.png 

I have also tried to increase the image width and height as I increase the
dpi - this maintains the extent of the image, but does not alter the dpi.
This method also results in some rather strange labelling  - the number of
labels increases per feature.

Cheers

Simon



-- 
View this message in context: http://www.nabble.com/Overriding-DPI-tf4395160s16610.html#a12533054
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list