A 9 patch image is an image that has stretchable areas defined. These areas are defined in a special 1 pixel wide border around the area. Add black pixels to the top and left of this border to describe
where the image can be stretched horizontally and vertically.
Why we use 9Patch Images?
Nine patch images are especially useful when designing buttons. Custom drawn buttons can look distorted and pixelated when their borders are stretched in addition to the rest of the image.
Create 9Patch Image.
Open Android SDK/tools and Inside this folder will be the draw 9 patch program. On Windows, double click on draw9patch.bat and on Linux open path in terminal and call ./draw9patch. new program window opened. Simply drag png image to this window.
After an image has been loaded into the Draw 9-Patch program two panes of information will appear. The left pane is used to edit the patches. The right pane shows what the image will look like when it is stretched in a couple of different ways.
After editing.Save the file.
9Patch image is save with extension .9.png .
Thanks,
Happy Coding!!
0 Comment(s)