Dpi, ppi, dip, dp, px, sp, dpippi

Source: Internet
Author: User

Dpi, ppi, dip, dp, px, sp, dpippi

Basic Concepts

1. dpi (dots per inch): The number of dots per inch; ppi (Pixel per inch): The number of dots per inch. Designed for the monitor, dpi = ppi.

2. dip (device independent pixels) devices are independent pixels. Different devices have different display effects, which are related to device hardware and do not depend on pixels.

3. dp (Density-independent pixel), an abstract unit based on screen Density. 1dp = 1px on a display at 160 o'clock per inch.

4. px (pixels) pixels are the actual pixel units on the screen.

5. sp (Scale-independent pixels), which is the font unit of Android, based on the 160PPI screen. When the font size is 100%, 1sp = 1px.

 

Second calculation method and conversion

Dpi = √ (Length: + width:)/screen diagonal inches

Conversion Formula of dp and px:

Dp * ppi/160 = px. For example, 1dp x 320ppi/160 = 2px.

Sp and px conversion formula:

Sp * ppi/160 = px

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.