[Galaxy Note 3 Themes and Apps] mikeymopar:
9PNG

I tried to keep this as short as possible...I didn't quote the entire OP coz then it would be an insanely long post instead of just this ridiculously long post...but I'm a reader and studier and not a video watcher so I figured I'd throw my hat into the .9png explanation ring. Hopefully someone, anyone can find some useful info here. And if it is contrary to the videos that have been linked in this thread, please let me know and I'll remove it so as not to confuse anyone. So get ready Lucy, I got some 'splainin to do......

1.	Known app that works.

2.	Decompile using APKTool to get….

3.	Decompiled app.

4.	Take the .9.png you want to change and….

5.	Copy it into your graphics program.

Now you have a choice depending on what you are attempting to accomplish. Left side path is pretty much just hue and/or color changes to the original image. Right side path is creating a new image altogether.

LEFT PATH

6.	WITHOUT ALTERING THE 1PX (black lines) BORDER – change the color, hue, and/or shape of the image as long as it remains within the boundaries of the 1PX BORDER. Save it back into your…

3.	Decompiled apk replacing the existing original .9.png.

2.	Compile using APKTool.

7.	You now have a new apk that needs a bit of manipulation still.

8.	Open both your “original.apk” that you used in Step 1 and your newly compiled app using 7-Zip or WinRAR. Drag both lib and meta-inf from the “original.apk” into your newly compiled app thus replacing those two files making certain that it is NOT compressing them (should be set to Store, that is, NO compression). Close both of them.

Sign your new app and then zipalign. Then it’s ready to be installed.

RIGHT PATH

6.	Make a temporary frame that is 2PX shorter and narrower than the original .9.png that you are replacing. (Later, when you run it through the Draw 9 Patch program, you get the 2PX back since it adds a 1PX border around the entire image) Create your new image within this frame. Hint: Not necessary but try to keep the space from your created image and the frame the same as the space from the original image to its 1PX (black lines) border to keep things lining up.

7.	Save the png and drag it into Draw 9 Patch (pics below). Add the left and top pixels to set where you want the image to stretch from. Then add the right and bottom pixels to set where you want the text to fall within your image. Hint: Usually one pixel is all that is needed for the left and the top “stretch” borders. Avoid placing pixels at curves as they don’t like to stretch. Be sure to click on the “Show bad patches” icon towards the top to help pixel placement. Save your completed .9.png image.

Now you have yet another choice. Your newly saved .9.png from Draw 9 Patch hasn’t been properly compiled yet; it still has the 1PX (black lines) border around it. You can treat it as such and go back to the left path and copy it into your decompiled.apk, compile, etc…OR…..

8.	Throw the image in a 9PNG Compiler and

9.	Save it.

1.	Now you can put this directly in your “original.apk” and then

10.	Sign, zipalign, and install.

HERE is a very handy tool for taking your images from Draw 9 Patch, compiling them, and then pushing them into your “original.apk”. As long as you keep folders straight it’ll do multiple apps and the images all at one time!

Personal experience….I’ll modify an app for everything (xml, smali, regular pngs, whatever) except for the .9.pngs and make sure that it works. Then I’ll make a copy of my working modded app and use it as my “original.apk” in Step 1 because .9.pngs are tricky to get 100% right the first time and they are usually what you want to mod to get a different look to your app without changing your working base. If you are just learning .9.pngs then follow the Left Path since it will definitely catch any broke .9.png when compiling using APKTool. If it errors out, whether it’s only a couple error messages or more than you can count, just look at your .9.pngs and if you don’t see a glaring problem, maybe just do a couple at a time and see which one causes APKTool to error. When you’re confident in your .9.png skills (seriously doesn’t take but a few attempts) I think the Right Path is a bit quicker especially when using the 9Compiler Batch Tool linked above.

Android SDK>Tools>Draw9Patch

Using a current trial text box (it didn’t quite look as good as I hoped for in my finished “base” app) it is pretty easy to see how to place the 1PX borders –

Left and top 1PX lines dictate how your image stretches. I didn’t want my arrow to stretch at all so I placed my 1PX lines off of the image as shown by the blue imaginary lines. (Note: Your image will stretch anywhere. It doesn’t need to be located even within the visible part of the image.)

Right and bottom 1PX lines dictate where the text will fall within your image as shown by the green imaginary box -- not intruding into the arrow and evenly spaced within the image itself.

Cheers