This project is read-only.

snapshot resolution

Feb 21, 2011 at 10:41 AM


I tried snapshot3 and I always obtain images with 120 PPI.

Is this value is set by mapwingis or it depends on something else and can change on other computers?

Feb 23, 2011 at 2:00 AM


SnapShot3(left As Double, right As Double, top As Double, bottom As Double, Width As Long) As Object
I don't know for sure because I'm just bumbling along with this image stuff but in the syntax above, the left,right,top and bottom define the location of the snapshot. The width is (I think) the number of pixels across that area. The bigger the number the higher the res.

A jpg given a width of 1000 always comes up with dimensions of 1000x something else. Give it a width of 3000 and a jpg covering the same area has dimensions of 3000x something else. That indicates the res has gone up. Hope I'm on the right track.

Feb 24, 2011 at 9:17 AM

Thanks for your answer mikmyro.

the 'width as long' is the number of pixes,l but it doesn't change the resolution. The test I done always give me a resolution of 120 PPI

for A width of 500, i've got an image  with a 4.16 inches width

If a set the width  with 2000, I've got an image with  16.6 inches

I need to obtain a 20 centemiter width image, so the code I done is :

 pW = Round((20 * 120) / 2.54, 0) 
 Set imge = frm_main.Map.SnapShot3(grille.Extents.xMin , grille.Extents.xMax , grille.Extents.yMax , grille.Extents.yMin , pW)

It works if the resolution is always 120 PPI. I'm not sure of that.

Feb 25, 2011 at 11:07 PM

Hi andal,

The PPI of the image should be whatever your system is set to. So if your desktop is setup to run at 96PPI thats whats used or 120 in your case. But it doesn't really matter, the PPI information stored in an image is just a little bit of metadata. Its very easy to change it and it really has nothing to do with what is actually stored in the image.

If you want to print an image that is 20cm = aprox. 8inch wide at 300 PPI then you need to generate an image that is 8*300 = 2400 pixels wide.

Then using whatever software you want to print the image you indicate that it should be printed at 300 PPI at it will come out 8 inches wide. But all printing software is a bit different, some rely on the PPI of the image carefully, others will stretch the image to fit whatever the pape size is.

Just remember that all bitmap images regardless of format (jpeg, bmp, png) don't have a defined size.


Brian M.

Feb 28, 2011 at 7:38 AM

Thanks brian

I wanted to have a defined size to insert snapshots into a word document with a scale bar.

So I should consider than the snapshot can give 300  PPI images and define a smaller size for the image into the word doc.

The quality will always be good enough :

 pW = Round((centimeterWidth * 300) / 2.54, 0) 
 Set imge = frm_main.Map.SnapShot3(grille.Extents.xMin , grille.Extents.xMax , grille.Extents.yMax , grille.Extents.yMin , pW)

Feb 28, 2011 at 3:55 PM

Hi Andal,

Exactly, in your case use word to set the width of the image on the page to the same value as centimeterWidth in your code there. Then you can calculate the scale based on:

((grille.Extents.xMax - grille.Extents.xMin) * yourMapUnitToCmConversionFactor) / centimeterWidth

Brian M.

Dec 23, 2011 at 12:54 PM

Hello everybody,

from what I read in this post it seems to me, that it could be possible with some calculation to retrive a snapshot:

- of a given width and hight (i.e. 20 cm wide and 10 cm high)

- of a given solution (i.e. 300 ppi)

So my question is:

wouldn't it be possible to use snapshot3 to retrive an image that has:

- a given width and height

- a given solution

- and a given scale (i.e. 1 : 1500) around the centre of the screen?

To me it looks like a bit of maths (?) - but as I'm not very good at maths - I would be greatfull if anybody could give me a few hints or stop me if I'm wrong.

Thanks and regards Helmut