问题描述
如何计算 AVD 的抽象 LCD 密度?
How do you calculate the Abstracted LCD Density for an AVD ?
推荐答案
抽象 LCD 密度以每英寸点数为单位(请参阅 docs).
The Abstracted LCD Density is measured in dots per inch (see the docs).
维基百科关于像素密度的文章有一个有用的部分解释了如何计算这个:基本上沿对角线每英寸的像素数可以通过这个公式计算,其中 x
和 y
是水平和垂直分辨率(因此 sqrt(x*x + y*y)
是以像素为单位的对角线长度),d
是以英寸为单位的对角线长度:
The wikipedia article on Pixel density has a helpful section explaining how to calculate this: basically the number of pixels per inch along the diagonal can be calculated by this formula, where x
and y
are the horizontal and vertical resolution (so that sqrt(x*x + y*y)
is the length of the diagonal in pixels), and d
is the length of the diagonal in inches:
sqrt(x*x + y*y)/d
例如,LG Optimus One P500 被列为有屏幕320
的分辨率为 480
,屏幕对角线尺寸为 3.2
英寸,因此它的密度非常接近 180dpi代码>.
So for example, a LG Optimus One P500 is listed as having a screen resolution of 320
by 480
, and a diagonal screen size of 3.2
inches, so it would have a density very close to 180dpi
.
这篇关于抽象的 LCD 密度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!