Reputation: 49
Different between nine-patch Image vs regular Bitmap Image in Android. and where we use nine-patch Image and where we use regular Bitmap Image.
Upvotes: 1
Views: 3961
Reputation: 117
9 patch images allow you to choose the area of the image that can be scaled and the area that should keep unscaled, unlike the regular images that are scaled along height and width in the same way.
For example this image, where the corners will not be scaled
It is useful for layouts that can vary greatly in size.
To control scaling in regular images you can use ScaleType property of ImageView
Upvotes: 1
Reputation: 168
These description from Google search: What Are 9 Patch Images
https://github.com/chrislondon/9-Patch-Image-for-Websites/wiki/What-Are-9-Patch-Images
Google Slideshow: https://docs.google.com/present/view?id=dc7ghz8w_34f8338rcg
very very helpful tool to understand 9 patch image: https://romannurik.github.io/AndroidAssetStudio/nine-patches.html#source.type=image&sourceDensity=320&name=logo_cbfea26
Upvotes: 0