[英]Android image size (portrait only) for mdpi, hdpi, xhdpi, xxhdpi
I currently work on an android project that the app is force to portrait only, I already have some design pictures and I would like to cut the image to build the UI. 我目前在一个Android项目中工作,该应用程序仅可强制使用肖像,我已经拥有一些设计图片,并且我想剪切图像以构建UI。 However, the problem is how should I scale each picture? 但是,问题是我应该如何缩放每张图片?
What I found so far 我到目前为止发现的
xlarge (xhdpi): 640x960
large (hdpi): 480x800
medium (mdpi): 320x480
small (ldpi): 240x320
But I also found 但我也发现
hdpi = mdpi * 1.5
xhdpi = mdpi * 2
xxhdpi = mdpi *3
but actually the mdpi * 1.5 should be 480 * 720 ? 但实际上mdpi * 1.5应该是480 * 720? How should I resize the picture for each resolution? 如何为每种分辨率调整图片大小? thanks 谢谢
Those resolutions are only guidelines not absolutes, and represent a general amount of pixels in each dpi "bucket". 这些分辨率仅是指导性指标,而非绝对值,代表每个dpi“存储桶”中的像素总数。 I'd primarily use the scaling factors instead. 我主要使用比例因子。 So whatever your image's resolution, scale appropriately. 因此,无论您的图像分辨率如何,都可以适当缩放。 For instance, my raw image files are always designed as the xxhdpi version. 例如,我的原始图像文件始终被设计为xxhdpi版本。 Then I scale down by 3, 2, and 1.5 for the lower dpi versions. 然后针对较低的dpi版本按3、2和1.5进行缩放。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.