当前位置:网站首页>res中values-swxxdp计算
res中values-swxxdp计算
2022-07-22 01:56:00 【dongpingwang】
一. res中values-swxxdp计算
以四寸中控面板为例
通过
adb shell wm size
获取屏幕大小为480x480通过
adb shell wm density
获取屏幕显示密度dpi为160最小宽度计算方法: s w = 160 ∗ 手机宽度像素 / d p i sw=160*手机宽度像素/dpi sw=160∗手机宽度像素/dpi
过公式计算得sw=480,即文件类型是values-sw480dp
二.px与dp之间转换
屏幕像素px,计算公式为:
p x = 1 d p ∗ d e n s i t y px = 1dp * density px=1dp∗density
密度比值density,计算公式为:
d e n s i t y = d p i / 160 density = dpi / 160 density=dpi/160
如面板分辨率为480x480,dpi为160,density为1,那么px : dp = 1 : 1
边栏推荐
- 3d点云txt文件中删减nan点
- Pdf to image and content reading
- Spark总结
- 矽穀課堂筆記(下)
- MySQL exercise 1 knowledge of database
- 2022-07-18 eliminate traversal processing of exists subquery
- 等保合规2022系列 | 一个中心+三重防护,助力企业等级保护建设更科学
- Open source demo | release of open source example of arcall applet
- MySQL的锁机制:MyISAM 表锁、InnoDB行锁
- Redis uses jedis operation
猜你喜欢
随机推荐
你可知道“开源女王”是谁吗?--她面临被解雇的威胁,仍然坚持开源了某个著名项目
Release time test
Zcmu--1925: HX & XH's game (C language)
硅片厚度测量
硅谷课堂笔记(中)
MySQL写循环语句的方法
NAT技术
Huitong programming level 5 - Magic School Lesson 7
K-均值聚类建模以及编程实现
Huawei cloud computing fuisoncompute8.0 installation
3d点云txt文件中删减nan点
Wafer thickness measurement
Equal protection compliance 2022 series | one center + triple protection, helping the construction of enterprise level protection to be more scientific
JDBC编程
投票不能重复
硅谷课堂笔记(下)
JVM (一) --------- JVM 简介
Redis主从复制
安卓 kotlin 的简单使用
Excel file parsing