如何增加图象? [英] How to add images?

查看:139
本文介绍了如何增加图象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在文档看完之后添加图像:

I was adding images after reading in the documentation:

这意味着,如果您生成xhdpi设备一个200x200的图像,
  应该产生同样的资源在150×150的华电国际,为100×100
  MDPI最后一个75x75图像LDPI设备。

This means that if you generate a 200x200 image for xhdpi devices, you should generate the same resource in 150x150 for hdpi, 100x100 for mdpi and finally a 75x75 image for ldpi devices.

于是我的在XHDPI图像是 200×200 像素,我在华电国际形象是 150×150 像素,我的图片MDPI是 100×100 ,和我的LDPI图像是 75x75 ?阅读文档后,这是我的想法,但是当我碰到这个页面来了:

So should my images in XHDPI be 200x200 pixels, my images in HDPI be 150x150 pixels, my images in MDPI be 100x100, and my images in LDPI be 75x75? After reading the documentation, that is what I thought, but when I came across this page:

像素 Android的背景图像尺寸

Android background image size in pixel

的答案状态以用于不同的目录不同pixeol量。我现在该怎么做很困惑。这里是我现在在这里,请告诉我,如果我这样做正确的:

The answers state to use different pixeol amounts for the different directories. I am very confused now on what to do. Here is what I have here right now, please tell me if I am doing this correct:

在这里输入的形象描述

所以基本上,我花了重新调整大小在过去4-5个小时我的很多图片在这些文件夹的大小。现在,我想正确的...做我甚至重新大小呢?难道应该是100×100适用于mdpi?

So basically, I spent the past 4-5 hours re-sizing lots of my images to the sizes in those folders. Now I'm thinking...did I even re-size them correctly? Is it supposed to be 100x100 for mdpi?

基本上,我只是想知道,如果这些目录都应该有每个多少像素。因为我挂的问题,否则说。

太感谢了,

Ruchir

推荐答案

您做得很好,你做了什么,如果你真正想要的图像,是你缩放他们的大小。

You did well to do what you did, if you actually want the images to be the size you scaled them to.

让我们回顾一下:

MDPI 是基线密度160dpi。这意味着这是160x160的像素在 MDPI 将一英寸方形的图像。

mdpi is the baseline density, of 160dpi. This means an image that's 160x160 pixels in mdpi will be one inch squared.

华电国际重新presents 240dpi。同样的一寸见方将需要240x240像素,或大于 MDPI 资产1.5更大。

hdpi represents 240dpi. The same one inch square will need to be 240x240 pixels, or 1.5 larger than the mdpi asset.

xhdpi 解析320dpi,所以方必须是320x320像素。

xhdpi resolves 320dpi, so the square needs to be 320x320 pixels.

xxhdpi ,在480dpi带来的资产480x480像素。

xxhdpi, at 480dpi brings the asset to 480x480 pixels.

xxxhdpi 仅用于发射的图像,所以不用担心那里 - 这是640dpi

xxxhdpi is only used for launcher images, so no worries there -- it is 640dpi.

我们一般设计的载体,然后扩展到华电国际 xhdpi xxhdpi ; MDPI 仍然是相关的一些手机应用,但对于平板电脑,它几乎消失了 LDPI 已经过时了,用量少。比手机3%使用它。 Android将插值最接近图像的屏幕密度,如果完全匹配不可用。立竿见影的效果,华电国际 xxhdpi`就足够了。

We generally design in vector and then scale to hdpi, xhdpi and xxhdpi';mdpiis still relevant for some phone apps, but for tablets, it's virtually gone.ldpiis obsolete, with less than 3% of phones using it. Android will interpolate the closest image for the screen density, if an exact match is not available. For quick results,hdpiandxxhdpi` are sufficient.

现在注意, xhdpi 的200x200的是的例如的。您的像素大小会有所不同,根据你想要什么尺寸图像出现。以 MDPI 为指导 - 40dp为1/4英寸,80dp是1/2英寸,等等。 40dp是最小的体面命中目标,所以我不会做的按钮小于。一旦您建立资产的规模,你再称它 - 为1.5倍HDPI,2个为xhdpi和3对xxhdpi和渲染你的资产的方式

Now note that the 200x200 for xhdpi is an example. Your pixel size will be different, based on what size you want the image to be. Take mdpi as a guide -- 40dp are 1/4 inch, 80dp are 1/2 inch, and so on. 40dp is the smallest decent hit-target, so I wouldn't make buttons smaller than that. Once you establish the size of your asset, you then scale it up -- 1.5x for hdpi, 2x for xhdpi and 3x for xxhdpi, and render your assets that way.

Size Inches   mdpi    hdpi   xhdpi  xxhdpi
       0.10      16     24      32      48
       0.25      40     60      80     120
       0.50      80    120     160     240
       1.00     160    240     320     480
       2.00     320    480     640     960

..等等

这篇关于如何增加图象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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