简体   繁体   English

GDI +:更改DPI

[英]GDI+ : Changing DPI

I have two points that i need be to be clarifief on : 我有两点需要澄清:

  • changing image DPI from 200 to 100 does it mean that i have to resize the image by half or i could keep the actual dimensions but decrease the DPI. 将图像DPI200更改为100确实意味着我必须将图像调整一半,否则我可以保留实际尺寸,但要减小DPI。

  • I herd that GDI+ could be a nice alternative to change the image DPI, i googled in that way but i found no example showing how to change the DPI with GDI+. 我以为GDI +可能是更改图像DPI的不错选择,我以这种方式进行了搜索,但没有找到显示如何使用GDI +更改DPI的示例。

Any Idea about those questions, and thank you. 关于这些问题的任何想法,谢谢。

Changing the dpi of an existing image doesn't make much sense. 更改现有图像的dpi没有多大意义。 It records the resolution of the device that created the image. 它记录创建图像的设备的分辨率。 So that it can be displayed at the same physical size on another device with a different dpi setting. 这样就可以在具有不同dpi设置的另一台设备上以相同的物理尺寸显示它。 Which is how an image you drew in a painting program on a monitor with 96 dpi doesn't turn into a postage stamp one-sixth the size when you print it on a printer with 600 dpi resolution. 当您在分辨率为600 dpi的打印机上打印时,以96 dpi的显示器在绘画程序中绘制的图像不会变成邮票大小的六分之一的方式。

By changing it in your code when you already have the image, you are basically trying to change the characteristics of the device that created the image. 通过在已有图像时在代码中进行更改,基本上是在尝试更改创建该图像的设备的特征。 That doesn't make sense, your code cannot reach back and, say, change the CCD in the camera or change the monitor resolution. 那没有道理,您的代码无法返回,例如,更改相机中的CCD或更改监视器分辨率。

It's just a reference number. 这只是一个参考数字。

You can display or print the image at any size you want, it doesn't have to match the original size. 您可以显示或任何你想要的大小,在打印的影像,它没有以匹配原始大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM