android - 具有不同物理尺寸但具有相同像素尺寸和相同 dpi 的设备上的快照图像是否相同
问题描述
在 Android 中,如果我有来自不同制造商的多台设备,并且每台设备的物理尺寸不同,但它们的宽度和高度都具有相同数量的像素,并且都具有相同的 dpi,那么位图(Bitmap 对象)是否会包含确切的如果从所有这些屏幕截图中获取相同的图像?
因此,如果我有两台设备是 1440 x 2560 和 300 dpi,但一台设备是 100 毫米 200 毫米,而另一台设备是 150 x 250 毫米,那么存储到 png 文件的快照是否相同(假设您拍摄使用两键单击方法的快照)?
还是我没有考虑过的设备的其他属性最终会生成不同的图像?
解决方案
Not necessarily
Android rendering isn't guaranteed to be pixel-perfectly identical across devices.
The biggest differences are likely to occur across API version changes. For instance, text rendering improved significantly in KitKat (for instance, it gained ligature support). Almost any layout containing text would look different after that update.
More subtle differences in the 2D rendering could occur as the underlying libraries like Skia are updated. Generally, I wouldn't count on exactly reproducible results unless they're coming from the same device. It's possible that it will be the same, but there could be differences.
推荐阅读
- c++ - 如何解决free():在双向链表中分配多个变量时出现无效指针错误?
- r - 在 R 中平均 3d 数组中的 n 值
- sql - 没有列名的 sys_refcursor
- javascript - 如果列中已存在值,则取消 Postgres 插入
- qt - 在 Qt 的设计视图和代码视图中更改小部件的名称
- google-apps-script - 如何仅将电子邮件发送到谷歌表格中选定的电子邮件?
- sql - 根据条件从另一个表中插入一个表中的记录
- python - Pandas - 连接两个数据框并在新列上添加列值
- c# - 在 API 中使用 ActionResult 类方法
- sql-server - ConnectionError [SequelizeConnectionError]:无法连接到 localhost:1433 - 无法连接(序列)Node.js、Sequelize 和 Heroku