有没有办法从大规模的形象创造xxhdpi,xhdpi,华电国际,MDPI和LDPI可绘制?
有没有一种方法来自动大规模映像创建xxhdpi,xhdpi,华电国际,MDPI和LDPI可绘制?例如,假设我有一个512×512的图像,我希望有不同版本的图像通过Android的在相应的文件夹支持不同的屏幕分辨率。
Is there a way to create xxhdpi, xhdpi, hdpi, mdpi and ldpi drawables from a large scale image automatically? For example assume that I have a 512x512 image and I want to have different versions of this images for different screen resolutions supported by Android in appropriate folders.
选项#1:只要船 -xxhdpi
可绘制,让Android的下采样他们为你在运行时(不足:只能在相当新的设备,其中 -xxhdpi
是已知的)
Option #1: Just ship the -xxhdpi
drawables and let Android downsample them for you at runtime (downside: will only work on fairly recent devices, where -xxhdpi
is known).
选项2:使用 Android的资产工作室下采样它们。
Option #2: Use Android Asset Studio to downsample them for you.
选项#3:自动化中的图形编辑器的过程中,每ssantos答案
Option #3: Automate the process within a graphics editor, per ssantos' answer.
第4个选项:脚本自己的解决方案,使用类似的ImageMagick
Option #4: Script yourself a solution, using something like ImageMagick.