Or Continue to Thread: [Guide/Tutorial][17/06/12]How …
Find Your Device:
15th February 2012, 09:45 PM   |  #73  
dully79's Avatar
OP Recognized Themer
Flag Durham/Liverpool
Thanks Meter: 3,221
 
2,731 posts
Join Date:Joined: Apr 2010
Donate to Me
Exclamation 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.

TIP: 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.
Or
Open it up with draw9 and add borders.

Hope this helps.
Last edited by dully79; 15th February 2012 at 10:21 PM.
The Following 8 Users Say Thank You to dully79 For This Useful Post: [ View ]