What is the difference between a regular bitmap and a nine-patch image?

Asked 10-Jan-2018
Viewed 746 times

2

What is the difference between a regular bitmap and a nine-patch image?


1 Answer


1

a nine patch image is a stretchable bitmap which has some certain features. this kind of image has all four corners unscaled and edges and centre part of the image is scalable

nine patch image is a standard .png file and stored in res/drawable/  directory of your project.  the image has an extra 1-pixel black border which is considered as the stretchable section of the image which is in the top and left part of the border whereas other parts are indicated as the white or transparent.

in your image, a user can have any number of stretchable section as the relative size remains the same. if these images are used in the background of the text these are automatically fit to the text.