[Galaxy S II Themes and Apps] LeoMar75:
Hi guys,

Since i have received several requests on how to create a NinePatch graphic for .9.png images i made this guide that will cover this topic!

This video tutorial shows how use Draw 9-patch tool, it allows you to easily create a NinePatch graphic using a WYSIWYG editor.

Draw9patch application is located inside your Android SDK /tools directory.

Unfortunately, I have seen most themers around here that don't know how to properly edit .9.png!

Usually, when i decompile a themed apk i always receive warning for bad patches and this is really bad... you guy should know that this is the ABC for themers!

Below, an example of a decompiled framework-res.apk with bad 9.png image patch:

I: Loading resource table...
I: Decoding resources...
W: Cant find 9patch chunk in file: "drawable-hdpi/btn_toggle_on.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/btn_dropdown_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/grid_selector_background_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/list_selector_background_longpress.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/menuitem_background_focus.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/menuitem_background_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/gallery_unselected_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/grid_selector_background_focus.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/btn_dropdown_disabled_focused.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/status_bar_item_background_focus.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/frame_gallery_thumb_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/btn_keyboard_key_trans_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/btn_media_player_selected.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/quickcontact_badge_small_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/gallery_selected_focused.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/list_selector_background_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/list_selector_background_focus.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/gallery_selected_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/btn_dropdown_selected.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/quickcontact_badge_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/btn_media_player_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/frame_gallery_thumb_selected.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/highlight_selected.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/highlight_pressed.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/status_bar_item_background_pressed.9.png". Renaming it to *.png.
I: Copying assets and libs...

This happen because themers edit .9.png by using directly Gimp or Photoshop and don't know that this kind of format need to be patched and recompiled after editing!

In addition when you get this kind of warning you can't recompile apk, you can only remove the bad .9.png images and leave the .png image that apk-manager (or whatever tool you are using) has created! Therefore you will lose important information for padding and stretching rules that comes with .9.png format!

You can't recompile the apk because you will have 2 filename with the same ID public resource!

Also you need to know that bad .9.png images can lead to bootloop issue and also problem with text overlapping and bad stratching for images expecially when the device is in landscape mode.

Draw9patch Tutorial [HD]

I recommend to watch it on youtube because here you can't really see..

[YOUTUBE]IfrXE2R2nqM[/YOUTUBE]

Hope it can help!

P.S.

Please don't care about my english, i know that is bad :D:D:D