我正在做一个Android项目.我有每单位像素的图像面积.我怎样才能把它换成平方英寸呢?
我在一个特定的图像中测试了单位的转换.我在Java中使用了这个特定的公式进行转换.
float inchesWidth = (float) width / dpi;
float inchesHeight = (float) height / dpi;
float areaInSquareInches = inchesWidth * inchesHeight;
假设图像的宽度为678.图像的高度为452.安卓设备的dpi为440.我得到的面积=1.58平方英寸.有没有人能证实我用的是正确的公式和方法,因为没有办法证实这一点.