Select to view content in your preferred language

VBA: Need help finding the resolution (DPI/cellsize) of an arbitrary raster

388
1
01-03-2012 10:19 AM
ChrisWelch
Emerging Contributor
Hi all.

I'm looking for a way to read the DPI of a raster in ArcObjects. I have the layer loaded up in ArcObjects as an IRasterLayer. Using this, I can find the width and height of the image, the "DisplayResolutionFactor", and other great information, but not the actual DPI of the image.

Is there an easy way to get this information? Everything I find online seems to deal with exporting, but I just want to know if the image is 300dpi, 1200dpi, 2400dpi, etc. Any thoughts?
0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor
Chris,

I'm not too hot on this subject but I've always understood dpi (dots per inch) as something that output devices use (printers/screens) so dpi has no meaning when you look at a raster and is probably why there is no interface that exposes such a property.  I came across this web page which tries to explain what dpi is.

Your thread title also suggests you want to know about cell size, if so then use the interface IRasterInfo.

Duncan
0 Kudos