当缺少适当的图像时,使用什么图像(具有更小或更高的 DPI)来准备图像?

What image (with smaller or higher DPI) is used to prepare the image when appropriate is missing?

我有 phone xhdpi 屏幕。我使用图像 abc.jpg 但 xhdpi 没有这样的图像。但是有一个图像具有较高的 DPI (drawable-xxhdpi/abc.jpg) 和较低的 (drawable-hdpi/abc.jpg)。 哪一个将用于为我的密度屏幕准备(缩放)图像?

摘自 Android 开发者页面:

Note: Using a density qualifier doesn't imply that the resources are only for screens of that density. If you don't provide alternative resources with qualifiers that better match the current device configuration, the system may use whichever resources are the best match.

最佳匹配:

If the qualifier in question is screen pixel density, Android selects the option that most closely matches the device screen density. In general, Android prefers scaling down a larger original image to scaling up a smaller original image.

源页面:https://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

基于此,我假设将使用更高 dpi 的图像,但是目视检查可能会证实这一点,即如果图像不模糊,则可以安全地假设它没有被放大。