Hi,
I have some image bigger than A4 (ISO format 8.27 × 11.7 inches) in 300 DPI. I want to reisze it to A4 format and set it to their original resolution (300 DPI).
Scale, resize, resizeWidthRatio always change the horizontal (and/or) vertical resolution, but no "real" image width or height
Is there a way to do it with Gd ?
Thanks,
Resize, keepiing resolution
Re: Resize, keepiing resolution
I'm not sure to understand what you mean, "real" image width or height is based on the actual width or height in pixels together with the resolution.
For instance an A4 format image is 8.27 × 11.7 inches so at 300 DPI the image will have a size of 2481 × 3510 pixels, it always follow this equation:
So altering the width or height of the image will obviously result in altering the other factors as well.
That being said, there is nothing that prevents you from manually setting the resolution to 300 DPI after the resize operation by calling SetHorizontalResolution and SetVerticalResolution methods.
For instance an A4 format image is 8.27 × 11.7 inches so at 300 DPI the image will have a size of 2481 × 3510 pixels, it always follow this equation:
Code: Select all
pixels = inches × resolution
That being said, there is nothing that prevents you from manually setting the resolution to 300 DPI after the resize operation by calling SetHorizontalResolution and SetVerticalResolution methods.
Re: Resize, keepiing resolution
Thanks for answer and I did exactly what you said (setting manually horizontal / vertical DPI) after resize.
Who is online
Users browsing this forum: No registered users and 1 guest