PX DPI PPI等概念

来源:互联网 发布:如何在淘宝上开好网店 编辑:程序博客网 时间:2024/05/18 16:14

PX

pixel,像素点,就是屏幕中最小的显示单位,放大看屏幕可以看出来就是由一个个发光的点组成的。

DPI

Dots Per Inch

PPI

Pixels Per Inch,开发中几乎可以跟DPI等同

Dots per inch (DPI, or dpi)[1] is a measure of spatial printing or video dot density, in particular the number of individual dots that can be placed in a line within the span of 1 inch (2.54 cm).
Monitors do not have dots, but do have pixels; the closely related concept for monitors and images is pixels per inch or PPI. Many resources, including the Android developer guide, use the terms DPI and PPI interchangeably.

DP/DIP

Density-independent Pixels

px=dp*(dpi/160)

与像素密度无关的的单位,应为Android的设备尺寸实在太多了,像素密度差别也会很大,因此有了dp这个与像素密度无关的单位。

SP

Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user’s font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and user’s preference.

类似于dp,给字体用的

0 0