Thanks Meter 2958
Join Date: Apr 2010
DONATE TO ME
The skinny on .9's
What are are .9.png's and how do i edit them??
.9's are very simple to use, it's when they are created incorrectly they become a pain in the arse.
.9.pngs use a 1 pixel BLACK (000000) border to determine its characteristics and how it behaves.
The green borders (top and left) controls which part of the image is stretched.
The red borders (bottom and right) controls where the text is displayed on the image if applicable.
The image below shows you how the borders contol a .9.png:
I used green and red for display purposes!!.
WHENEVER EDITING .9.PNG'S ALWAYS ENSURE THE BORDERS ARE NOT COMPRIMISED AND MUST BE A SOLID BLACK, RGB CODE= 000000
You can use a graphics editor to create these borders but i prefer to use "draw9patch.bat" tool which comes with android sdk. draw9 lets you preview what your stretched image will look like.
If your image has rounded corners avoid adding pixels around them like the image above. This will prevent the png from being stretched and looking like a turd!
When do i edit the 9patch border??
If you decompile an apk and make edits to a .9.png please check that your borders are unaffected and remain black/000000.
If you create an image from scratch then expand the canvas 2x2 pixels (thats a 1 pixel border for each side) and draw your BLACK borders.
Open it up with draw9 and add borders.
Hope this helps.