本文介绍了像素到厘米?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想知道像素单位是否不变,是否可以将像素转换为厘米?

I just want to know if the pixel unit is something that doesn't change, and if we can convert from pixels to let's say centimeters ?

推荐答案

类似于,它询问的是点而不是厘米.每英寸有72个点,而每英寸有2.54厘米,因此在该问题的答案中用2.54代替72.我将在此处引用并更正我的答案:

Similar to this question which asks about points instead of centimeters. There are 72 points per inch and there are 2.54 centimeters per inch, so just substitute 2.54 for 72 in the answer to that question. I'll quote and correct my answer here:

厘米=像素* 2.54/96

centimeters = pixels * 2.54 / 96

有一种方法称为GetDeviceCaps,用于获取Microsoft Windows显示器每英寸的配置像素. Microsoft有一个名为开发可识别DPI的应用程序"的指南,请查找创建可识别DPI的字体"部分.

There is a way to get the configured pixels per inch of your display for Microsoft Windows called GetDeviceCaps. Microsoft has a guide called "Developing DPI-Aware Applications", look for the section "Creating DPI-Aware Fonts".

这篇关于像素到厘米?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 00:54