I want to create a ninepatch background file (the background is a gradient image). I would like to know what are the ideal dimensions of the background image?
In addition to that, where should I put the image: drawable-ldpi
, drawable-mdpi
or drawable-hdpi
?
Check your SDK folder inside: /platforms/android-X/data/res/drawable-hdpi
You will notice there are a bunch of 9patches there. I understand that you should provide a 9patch for each type of device. So you should have a 9patch for ldpi
, one for mdpi
and one for hdpi
.
The idea is to make it as small as possible and also take into account that the 9patch doesn't go smaller than the original.
On the other hand, I don't think that a 9patch will be useful when dealing with gradient images. I would try using a GradientDrawable.