当前位置:网站首页>How big is 1dp!
How big is 1dp!
2022-08-08 17:18:00 【Wholehearted】
Why is 1dp a fixed length?How long is it?
Why do you say px is a relative length, if you don't know dpi, you don't know how long it is.
First of all, we have to distinguish a concept
Control, text, we use dp, sp, so on different devices, it will be converted into corresponding px according to the dpi of the device
Therefore, it is guaranteed to be the same size on different devices.
For example, how big is 1dp
1dp runs on a 160dpi machine, then 1dp=1px and knowing that dpi=160 means that there are 160 pixels per inch, then the length of a pixel is 1/160 of an inch.
And 1dp runs on a 320dpi machine, then 1dp=2px knows dpi=320, that is, the length of a pixel is 1/320 inch, to display a 1dp control requires 2px, then the length is 2*1/320 Still yes1/160 of an inch, so the length is fixed.
As for the picture, since the unit of the picture is px, it needs to be adapted. It is necessary to create different folders according to different devices, and store the different pixel sizes of the same picture in different folders. When the real machine is runningThe pictures in the appropriate folder will be loaded according to the dpi of the real machine.
And if you only have one image, the px size is fixed. Naturally, when running on different devices, the displayed size of this image is different.
边栏推荐
猜你喜欢

LeetCode_Binary Tree_Medium_515. Find the maximum value in each tree row

VISTA无人驾驶模拟器;FinRL量化金融深度强化学习库;『深度神经网络应用』电子书;CUDA/TensorRT案例集锦;前沿论文 | ShowMeAI资讯日报

leetcode:294.翻转游戏

一、搭建django自动化平台(实现一键执行sql)
![[Paper Reading] RAL 2022: Receding Moving Object Segmentation in 3D LiDAR Data Using Sparse 4D Convolutions](/img/6c/2d8469b2113f6c23c5b75e6f6e479e.png)
[Paper Reading] RAL 2022: Receding Moving Object Segmentation in 3D LiDAR Data Using Sparse 4D Convolutions

ARP协议详解,小白易懂

Digital image processing (6) -- image compression

APICloud AVM wraps date and time selection components

KITTI数据集简介(一)—— 传感器介绍

信号生成和可视化
随机推荐
L2-026 小字辈 (25 分)
Cyanine5 tetrazine,Cy5 tetrazineCY5四嗪,1427705-31-4
L2-010 排座位 (25 分) (DFS)
[In-depth study of 4G/5G/6G topic-54]: L3 signaling control-3-segmentation of software functions and processes-signaling of CU-UP network elements
数字图像处理(六)—— 图像压缩
在指南针炒股软件中的指标靠谱吗?安全吗?
yarn : 无法加载文件 D:xxx\node_global\yarn.ps1 因为在此系统上禁止运行脚本
MySQL 表的增删查改
Are Huishang Futures official and reliable?Is it safe to open an account in Huishang Futures?
第二十章 源代码文件 REST API 参考(二)
好用的项目工时管理系统有哪些
mysql进阶(二十九)常用函数汇总
laravel数据库: 查询构造器
arm交叉编译
L2-013 红色警报 (25 分)(并查集)
C语言每日一练——Day01:求最大公约数(三种方法)
使用电脑通过VNC Viewer远程连接树莓派4B
中金财富开户安全吗?怎么操作?
徽商期货正规可靠吗?在徽商期货开户是否安全?
1dp到底多大!