What is the relevance of DPI in BitmapSource.Create() method?

耗尽温柔 提交于 2019-12-10 13:29:38

问题


i read the Wikipedia article on DPI, but it confused me even more... i don't have any DPI information on the image. What DPI should i use with BitmapSource.Create(), is it OK to use a constant one(96/72?) and does it really matter if i'm not going to be printing the image?


回答1:


DPI does not affect the pixels of a bitmap in any way. The DPI of an image is just attached metadata that is a measurement used to describe how large in real-world measurements is each pixel supposed to be.

For example, you can have two images which both represent an 8.5" x 11" scanned piece of paper. One might be from a higher resolution scanner at 600 dpi and therefore the dimensions of the pixels would be 5100x6600 at 600 dots per inch. That same piece of paper could be scanned by a lower resolution scanner at 300 DPI and therefore would only have a resolution of 2550x3300.

Now let's say you want to display both of these images on the screen side by side to compare the pieces of paper. They should be the same size on your screen. Most likely the larger image would be scaled down and not all of the pixels would be visible. They are still there however, and if you zoom in on the image you'd see the finer quality. Zooming in on the lower resolution image would result in a significantly lower quality.

DPI is used to allow you to show various images on the screen and have them maintain proper size ratio to each other. It's also important for printing.

As a rule you should stick with the default DPI of 96 unless you have a reason not to.



来源:https://stackoverflow.com/questions/15579376/what-is-the-relevance-of-dpi-in-bitmapsource-create-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!