1

I have to design three resolution for android..there i have to design 3 types of images for

1)drawable hdpi

2)drawable ldpi

3)drawable mdpi.

for these it is best to use 9-patch images for all the three folder??????????.

Is it possible to achieve this ?Please give suggestion on this?? enter image description here

Booshan
  • 97
  • 1
  • 3
  • 11
  • Put `9-patch` image on `drawable` folder. – Aspicas Oct 22 '15 at 09:47
  • Obviously, for best results, you have to prepare and put the scaled versions of your 9 patch in every density slot. – Phantômaxx Oct 22 '15 at 09:51
  • 2
    I think you should add more question marks to your question. – m02ph3u5 Oct 22 '15 at 09:59
  • if use 9 patch image means? i have to design image for(48 * 48)...it can used as (72 * 72)....and also (100 *100)??? – Booshan Oct 22 '15 at 10:14
  • one more ...this is the link:http://developer.android.com/tools/help/draw9patch.html for create 9 patch image???? – Booshan Oct 22 '15 at 10:15
  • one more thing is......is it possible to have design images for(480*800)...(design using illustrator)...this images can be used for higher resolution like (720 and 1090) ?? – Booshan Oct 22 '15 at 10:51
  • Yes, scale your pictures, THEN add the 1px border for the markers. The [draw9patch](http://developer.android.com/tools/help/draw9patch.html) tool is just for TESTING, not for drawing. You CAN use the same 9 patch for all the resolutions, but you better scale them - for better results. – Phantômaxx Oct 22 '15 at 11:21
  • here scaling means what? how to scale it? – Booshan Oct 22 '15 at 11:32

1 Answers1

1

If you are going to use 9 patch image, then put that only in Drawable folder, if the non-stretchable area is very small. This means, you will have only one version of the 9 patch image. But if this is not the case, then as Frank mentioned in the comment, you need to create 9-patch images for all densities.

More information here: https://stackoverflow.com/a/9941850/4747587

Community
  • 1
  • 1
Henry
  • 17,490
  • 7
  • 63
  • 98
  • 1
    No, not really. The idea is to reduce the image size, not having to provide a full image, but simply stretching the areas. Your solution will show different results at different densities (i.e.: the non stretched areas will be smaller on higher density screens and larger on lower density ones) – Phantômaxx Oct 22 '15 at 09:54
  • if use 9 patch image means? i have to design image for(48 * 48)...it can used as (72 * 72)....and also (100 *100)???...without any bluring occurs in the image? – Booshan Oct 22 '15 at 10:25
  • Depends on the image. But I think for 100dp, one 9 patch should be sufficient. Instead of designing for 48x48, design for 100x100. – Henry Oct 22 '15 at 10:30
  • one more thing is......is it possible to have design images for(480*800)...(design using illustrator)...this images can be used for higher resolution like (720 and 1090) ?? – Booshan Oct 22 '15 at 10:51
  • Yes, scale your pictures, THEN add the 1px border for the markers. The [draw9patch](http://developer.android.com/tools/help/draw9patch.html) tool is just for TESTING, not for drawing. You CAN use the same 9 patch for all the resolutions, but you better scale them - for better results. – Phantômaxx Oct 22 '15 at 11:23
  • if the non-stretchable area is very small. means what? – Booshan Oct 22 '15 at 11:37
  • In the above image in your question, the stretchable area is the one where you see the 'black lines'. This is the repeating area. The corners 'outside the black lines' are the non-stretchable area. These will not be repeated and wont stretch. This non-stretchable area will act like normal png image. – Henry Oct 22 '15 at 11:47
  • it is possible to design images in illustrator for one resolution say(480 * 800)..can it support (720 *1280) and (1920)...i came to know that image designed using (illustrator) will give better support for multi-resolution – Booshan Oct 22 '15 at 11:57
  • Illustrator has nothing to do with this. It's not the application, but the format in which it is saved (vector). It's the PNG format, instead of JPEG format. PNG is lossless compression, hence we prefer that. But that doesn't mean that you can have one image for a resolution and use that for others. Also, using multiple images for various densities reduces runtime memory. See this for more info: http://stackoverflow.com/a/33279714/4747587. – Henry Oct 22 '15 at 12:02
  • finally ,we have to design images for drawable-hdpi,drawable-mdpi,drawable-large for multi resolution right? eg drawable-xxhdpi: 1920x1080 drawable-xhdpi: 1280x720 drawable-hdpi: 960x540 drawable-mdpi: 640x360 – Booshan Oct 22 '15 at 12:09