Image DPI question

Image DPI question

Forum member · Sep 11, 2006
Hi! Can someone please explain to me the relatioship between actual sizes in pixels and dpi? I have an image (.jpg) which PaintShopPro says has the size of 820 x 700 at 96dpi. When I try to show the image using basic code: Image imgTest = new Image("c:\myimage.jpg", 0, 420); and look at imgTest in Visual Studio debugger watch list, it shows ScaleX = 0.75, ScaleY = 0.75, Width = 615, Height = 525 (which I understand are the actual width and height as reported by PaintShoipPro multiplied by 0.75). Where does that 0.75 come from. Why is it hard-coded to be at athat scaling factor? And, one last question, when I have an image with exact same width and height (820 x 700), but it's in 200dpi, the image comes up very small. The only way for me to to show this image is to do: imgAd.SetDpi(96); imgAd.SetBounds(615, 525); A very basic tutorial would be very much appreciated (or, if yo don't have time to type it here, please point me at the appropriate documentation and I'll read it myself). Thanks in advance. Steve

Re: Image DPI question

Support · Sep 12, 2006
Hello Steve, Our product does not resample the images. Hence the pixel width and pixel height are always preserved from the actual image. However, if the scale of the image is decreased its dpi will increase but its actual point width and/or height will decrease. If a 300 x 300 pixel image is placed at 72 dpi (scale of 1), its width and height will be 300 x 300 points or 4.1667 x 4.1667 inches. If the same 300 x 300 pixel image is placed at 300 dpi (scale of 0.24), its width and height will be 72 x 72 points or 1 x 1 inch. Many image formats contain a target resolution within the file. If this information is present it is read from the file and used as the default resolution when a scale is not specified. More details about image resolution can be read in the Help Documentation on our web site. Thanks, ceTe Software Support Team

Re: Image DPI question

Forum member · Sep 12, 2006
Thank you very much!