简体   繁体   English

Android的Icons DPI

[英]Icons DPI for Android

I apologize for the simple question, but I am a bit confused. 对于这个简单的问题,我深表歉意,但我有些困惑。

I am creating my first Android app. 我正在创建我的第一个Android应用程序。 Functinally I am done. 功能上说我完成了。 I am now working on the UI. 我现在正在使用UI。 According to this , I am required to provide multiple icons to support different screens and I understand this part. 根据这个 ,我需要提供多个图标,以支持不同的屏幕和我理解这部分。

So I created a vector image, and was about to export it to generate a number of icons to support multiple resolutions. 因此,我创建了一个矢量图像,并将其导出以生成许多图标以支持多种分辨率。 However, I could not find the require DPI. 但是,我找不到所需的DPI。 According to this , I am supposed to support different DPIs, but the article does not explain how to do that. 根据这个 ,我应该支持不同的DPI,但文章并没有解释如何做到这一点。

Can you please advise me on how to select the proper DPI? 您能建议我如何选择合适的DPI吗? Does it even matter? 有关系吗 I thought it does, but maybe my understanding is wrong. 我以为可以,但是也许我的理解是错误的。

Thanks. 谢谢。

EDIT: 编辑:

Just to clarify my question. 只是为了澄清我的问题。 When I am exporting an image from a vector to a raster image, I have to select its dimension (so in my case, 400px X 200px), and its dpi. 将图像从矢量导出到光栅图像时,必须选择其尺寸(在我的情况下为400px X 200px)及其dpi。 So what should I choose for DPI? 那么我应该为DPI选择什么呢? Is that the same DPI that will create different icon sizes? 相同的DPI会创建不同的图标大小吗? I am confused. 我很困惑。 Thanks again. 再次感谢。

For what concerns dpi , I use to follow the screen dpi: 对于dpi来说 ,我习惯遵循屏幕dpi:

640 dpi for xxxhdpi screens xxxhdpi屏幕为640 dpi
480 dpi for xxhdpi screens xxhdpi屏幕为480 dpi
320 dpi for xhdpi screens xhdpi屏幕为320 dpi
240 dpi for hdpi screens 对于Hdpi屏幕为240 dpi
160 dpi for mdpi screens 适用于mdpi屏幕的160 dpi
120 dpi for ldpi screens ldpi屏幕为120 dpi

This way I'm sure the icons are appropriate to the screen resolution. 这样我确定图标适合屏幕分辨率。

I'm also sure that I can skip some (if not all) the lower qualities, once I have the highest resolution graphics, because they will scale down nearly perfectly. 我也确信,一旦我拥有最高分辨率的图形,就可以跳过一些(如果不是全部)较低的画质,因为它们将几乎完美地缩小

But, since I'm a perfectionist, nearly disturbs me. 但是,由于我是完美主义者,所以几乎打扰了我。
So, I do provide all the resolutions graphics. 因此,我确实提供了所有分辨率的图形。


For what concerns dimensions use this cheatsheet: http://petrnohejl.github.io/Android-Cheatsheet-For-Graphic-Designers/#dimensions 对于有关尺寸的问题,请使用以下备忘单: http : //petrnohejl.github.io/Android-Cheatsheet-For-Graphic-Designers/#dimensions


You can make this experiment: 您可以进行以下实验:
for an xhdpi screen, prepare a 800px X 400px image at 72 dpi ( and no other images for other resolutions ) and see how does it scale down in a lower resolution physical device, say an ldpi screen (it will look really bad )... 对于xhdpi屏幕,请准备一个72 dpi的800px X 400px图像( and no other images for other resolutions ),并查看如何在分辨率较低的物理设备上按比例缩小,例如ldpi屏幕(它看起来确实很糟糕 )。 。
Then prepare a 800px X 400px image at 480 dpi ( and no other images for other resolutions ) and, after scaling (will look very good , on the same ldpi screen), compare the result to the previous one. 然后准备一个480 dpi的800px X 400px的图像( and no other images for other resolutions ),缩放后(在同一ldpi屏幕上看起来很好 ),将结果与前一个图像进行比较。

The difference will be evident on a physical device, much less on an emulator. 差异将在物理设备上显而易见,而在仿真器上则更为明显。

It's a way of doing things when you want to save some bytes on lower resolution pictures: just prepare the highest resolutions ones and let Android scale them down (it will scale down the ones it doesn't find in their folders). 当您想在低分辨率图片上保存一些字节时,这是一种处理方式:只需准备最高分辨率的图片,然后让Android缩小图片(它会缩小在文件夹中找不到的图片)。

I am writing my conclusion for the greater good. 我写我的结论是为了更大的利益。 After further reading and investigation. 经过进一步的阅读和调查。 It appears that DPI is not important when I am creating an image for a screen. 当我为屏幕创建图像时,DPI似乎并不重要。 So when I choose 400px X 200px, and assuming this will be for mdpi, then I should choose 800px X 400px for xdpi (and so on and so forth). 因此,当我选择400px X 200px并假定适用于mdpi时,则应该为xdpi选择800px X 400px(依此类推)。 The dpi should be ignored in all cases (does not matter if I chloose dpi of 90 or 600, as long as this is not for printing). 在所有情况下,都应忽略dpi(我选择90或600的dpi无关紧要,只要这不是用于打印)。 On the other hand, if I am to print the image, then dpi is important. 另一方面,如果要打印图像,则dpi非常重要。


EDIT 编辑

This is a great article about the topic. 是一篇有关该主题的好文章。 Please read it, it explains things very well. 请阅读它,它很好地解释了事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM