首页 > 解决方案 > 具有不同物理尺寸但具有相同像素尺寸和相同 dpi 的设备上的快照图像是否相同

问题描述

在 Android 中,如果我有来自不同制造商的多台设备,并且每台设备的物理尺寸不同,但它们的宽度和高度都具有相同数量的像素,并且都具有相同的 dpi,那么位图(Bitmap 对象)是否会包含确切的如果从所有这些屏幕截图中获取相同的图像?

因此,如果我有两台设备是 1440 x 2560 和 300 dpi,但一台设备是 100 毫米 200 毫米,而另一台设备是 150 x 250 毫米,那么存储到 png 文件的快照是否相同(假设您拍摄使用两键单击方法的快照)?

还是我没有考虑过的设备的其他属性最终会生成不同的图像?

标签: android

解决方案


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.


推荐阅读