What I meant is dpi is not properties of pixmap, but rather device you work with.
What I meant is dpi is not properties of pixmap, but rather device you work with.
Thank you fanat9 and Gravis!
I totally agree with you both, but (I always have a but, hehe) some image formats, like PNG (I think that tiff and jpeg too) store a byte with the image DPI (I know it's not a real image property, because it depends on the device).
For example, if you do a PNG image with Fireworks, it store the dpi you choose for that image in the image file. So, when Fireworks, open the file again, can "translate" pixels to, for example, inches.
I agree that it all depends on the device, and not on the image, but I know some image format has that information embedded. I think the best would be to open the file, as binary, read that information from the image file.
Thank you again for the answers!! (and of course, you time)
@wysota:
This doesn't contain anything for a regular JPEG.
@orlando:
You have been misunderstood. The DPI you need is the information from acquiring the image. If you scan a ruler and want it printed out in the same scale, you need to know the DPI of the scanner / camera and the printer.
The information probably is stored in the metadata of your image file (EXIF or similar).
I know of no Qt function to retrieve this information.
Have you looked how old is this post?![]()
Òscar Llarch i Galán
It's probably a good thing that the poster averages only about 2 posts a year.
Bookmarks