Rishabh Srivastava
Rishabh Srivastava

Reputation: 3745

Using 9-patch images for application developement

I want to develop an application for all the resolutions only using 9-patch images. I will be having 9 patch images for hdpi and I will have to stretch and use them for other xhdpi and xxhdpi. Is it feasible and till what extent it is preferable to develop a big application using all 9 patch images??will it be inefficient?

Upvotes: 1

Views: 172

Answers (2)

Udi Oshi
Udi Oshi

Reputation: 6867

9-Patch is very common and useful tool. You can 9-patch PNG's.

Is it feasible and till what extent it is preferable to develop a big application using all 9 patch images?

It sure feasible, you'll need to decide yourself the extend of using, if you have many images in same pattern only different size so it would be good for you.

will it be inefficient

You can see 9 patch code here to see that onDraw() is very efficiently

Check this official document to get more knowledge.

Pay attention to this picture: enter image description here

Better tutorial for beginners is here,

Upvotes: 2

Emil Adz
Emil Adz

Reputation: 41099

9-Patches should be used in a way that you create it as small as possible, because it can only get stretched it can't get smaller the the original texture is.

Here is a small blog post I wrote on this topic that has some tools and explanation:

9-Patch Tools and Explanation

Upvotes: 2

Related Questions