tags:

views:

1326

answers:

3

Hi,

I'm writing an application to send some images to a third party, and the images must be 200x200 DPI. The image is a Bitmap and is sized at 500 width and 250 height.

The first time I tested the images with the third party, my resolution was incorrect. I merely used image.SetResolution(200,200) to correctly set it to 200x200. This, however, only changed the resolution tag for the image and did not properly, according to my third party technical contact, adjust the image height and width.

Is there a ratio that I can use so that for each X units I increment the resolution, I merely increment the corresponding height or width Y units? I thought that I could just increment resolution without having to increment height or width.

Thank you, Aaron.

A: 

When dealing with digital images, you usually refer to PPI, which is pixels per inch. DPI is not directly related to digital image resolution.

So, if you look at a image that is 200px by 200px @ 200PPI, you will have an image that is 1 inch by 1 inch.

Jon
+3  A: 

An image stored digitally has no meaningful concept of DPI. DPI comes into play when reproducing an image on a physical device.

You need to adjust the image size with regard to the DPI of the physical device, and the desired size of the output on that device.

For example, if a printer tells you they need an image at 300dpi to fill a space of 4in x 4in then you would provide them a bitmap with a size of 1200x1200 pixels. This image would end up with a physical size of 4in x 4in on a 300dpi output device. On a 600dpi device the same image would have an output size of 2in x 2in.

Dana Holt
Thank you very much. I believe this will solve my issue.
Aaron
You're welcome. :)
Dana Holt
The above answer in equation form: imgWidthPixels = dpiWidth * outputWidthInches imgHeightPixels = dpiHeight * outputHeightInches
Zachary Yates
A: 

All the answers are wrong! Everybody is idiots! Geez, why do you comment if you do not know anything?

Its true, you only set the files property tag. you need to resize the image with the relation of the DPI. i.e. 300 - 100 = 3. meaning newWidth = oldWidth / 3.. or something like that.

Img = new bitmap(imgOld, newWidth,newHeight)

The Boss
I down voted your answer because it is inflammatory, is very unclear, and doesn't appear to provide any useful information. Why do you comment if you do not know anything?
qstarin