如果我在xhdpi中有50dp宽/高的图像,我为mdpi做了多大的尺寸? [英] If I have an image 50dp wide/tall in xhdpi, what size do I make for mdpi?

查看:391
本文介绍了如果我在xhdpi中有50dp宽/高的图像,我为mdpi做了多大的尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与一位平面设计师合作,他正在尝试验证我当前在我的应用中使用的尺寸图像,这样他就可以为所有分辨率模式创建大小合适的新图像(以最小尺寸设计图像)然后为其他模式缩放它。)



在我的应用程序中,我正在模拟一个 720 x 1280:xhdpi ,在此设备上,ImageView的大小设置为 50dp x 50 dp



是这是正确的说 50 dp xhdpi - > 25 dp mdpi? 100px的?或50px?究竟是什么?我们应该为最小尺寸制作的正确尺寸是多少?

解决方案

根据 Android文档



从基本图片尺寸来看,有一个 3:4:6:8:12:16 DPI的可绘制大小缩放比率。

  LDPI  -  0.75x 
MDPI - 原始大小//表示1.0x这里
HDPI - 1.5x
XHDPI - 2.0x
XXHDPI - 3x
XXXHDPI - 4.0x

根据差值,您可以计算ImageSize resoultion。



更新:



您创建了不同大小的图像,如 HDPI MDPI XHDPI 。但这并不意味着您可以设置 ImageView 高度宽度根据它的 Drawable



示例:



<让我们的某些设备具有较小的screenSize,但它是高密度支持,所以你必须设置高分辨率密度图像,但在这种情况下你创建的小尺寸 ImageView


I am working with a graphic designer at the moment who is trying to verify what sizes images I am currently using in my app so he can create new images in the right size for all resolution modes (designing the image at the smallest size and then scaling it for the other modes).

In my app, I am emulating a device that is 720 x 1280: xhdpi, and on this device, an ImageView is set to size 50dp x 50 dp.

Is it correct to say 50 dp xhdpi -> 25 dp mdpi? 100px? Or 50px? What exactly? What is the correct size that we should be making for the smallest size?

解决方案

According to Android Documentation.

From a base image size, there is a 3:4:6:8:12:16 scaling ratio in drawable size by DPI.

LDPI - 0.75x
MDPI - Original size // means 1.0x here 
HDPI - 1.5x
XHDPI - 2.0x
XXHDPI - 3x
XXXHDPI - 4.0x

According to the upper difference you can calculate the ImageSize resoultion.

Update :

you have create different size of Image like HDPI, MDPI, XHDPI. but that is not mean that you can set ImageView Height and Width according to it's Drawable.

Example :

let's some device have small screenSize but it is high density support so you have to set high resolution density Image but the Size of the ImageView you have create small in that case.

这篇关于如果我在xhdpi中有50dp宽/高的图像,我为mdpi做了多大的尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆