Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi [GR32] How to get image resolution (https://www.delphipraxis.net/150192-%5Bgr32%5D-how-get-image-resolution.html)

WojTec 9. Apr 2010 19:36


[GR32] How to get image resolution
 
Hello guys,

I have small problem with something that probably is very simple. So, I have image in TBitmap32 object and must save it. When I saving it as JPEG I also updating or adding EXIF metadata. One of EXIF field is picture resolution (and second in thumbnail section). How to compute this resolution (the best in inches)?

rollstuhlfahrer 9. Apr 2010 20:28

Re: [GR32] How to get image resolution
 
Liste der Anhänge anzeigen (Anzahl: 1)
To get the resolution in inches you need to know how to compute your inches. Some Images have 120 px/inch and some have 96 px/inch. I think, you can get this factor by reading it from its original file. If you create a Bitmap im your TBitmap32 (like Painting) you can choose a factor. Usually it'S 96 or 120.

Hope I could help.

Bernhard

EDIT: I've tested thin with MSPAINT and the result-image has a resolution of 96 px/inch (=dpi) (see attached screenshot)

Klaus01 9. Apr 2010 20:48

Re: [GR32] How to get image resolution
 
N'Abend,

is does not make any sense do put the resolution px/inch into the exif.
The resolution is depending on the device where the image will be displayed or printed.

The screen resolution is between 72 and 96px/inch.
A printer can have a resolution of 150,300 or 600 dots(px)/inch.

So an image with an width of 1000 pixels has width on the screen of round about 10 inches.
Printed it is physicaly much smaller.

Hope it helps.

Klaus

WojTec 10. Apr 2010 18:47

Re: [GR32] How to get image resolution
 
Thanks for answers. I decided to don't save DPI or remove if exists. Thanks guys :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:06 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz