Conan Troutman · Apr 14, 2013 at 11:30 pm

Take Control of Those Pesky NinePatch Files

Everybody has a nemesis of some kind. Odysseus had Poseidon, for Captain Ahab it was the white whale, and Sherlock Holmes had Professor Moriarty. As for Android themers, well they have NinePatch (.9png) files.

If you aren’t familiar with NinePatch, check out this great tutorial which deals with the intricacies of working with these particularly troublesome image files. In summary, they are “stretchable” image files used for elements of the UI that often require resizing, such as a speech bubble used to contain a text message. Instead of storing multiple different sizes of the same image, it makes much more sense to simply resize the same one as needed, and that’s where NinePatch comes into play. Although on paper these files are an incredibly efficient solution to a problem, they can be a real nightmare to work with, as they need to be edited properly to avoid horribly misshapen and downright ugly images after the stretching takes place. And if you hadn’t already spent enough time messing around with one single file, when it dawns on you that you need to resize it for use on different screen sizes, this becomes a tempting solution to the problem.

Android Drawable Resizer by XDA Forum Member ~RoN~ should help to alleviate some of the frustration caused by these pesky images by allowing you to automatically resize the images for use on different resolutions. Once you have one size edited to your liking, simply use this Windows-based tool to specify it’s original density, select which densities you wish to create from your original, and the tool handles the rest. This is a fantastic time saver for any themers out there who aren’t afraid to tackle the NinePatch.

Check out the original thread for more information if you often find yourself spending too much time on this type of file.


_________
Want something on the XDA Portal? Send us a tip!

Conan Troutman

Conan Troutman is an editor on XDA-Developers, the largest community for Android users. Senior Moderator, Newswriter, Recovering Meme Addict. View Conan Troutman's posts and articles here.
Mario Tomás Serrafero · May 25, 2015 at 02:00 pm · 2 comments

XDA Office Space: Frankenstein’s Perfect IM Client?

The portal’s decentralized XDA office lies in a Hangouts chatroom, where we discuss the latest developments that hit the blogosphere, critique them and figure out what we can do to add a new or original point of view. We came to love this little virtual office, which sees messaging 24/7 due to the international nature of our team. The main problem that we have faced since early on is that Hangouts is not versatile enough for in-depth discussion.   What...

XDA NEWS
Emil Kako · May 25, 2015 at 12:32 pm · 4 comments

Which IM Client on Android is best?

With so many different messengers to choose from, it can be tough to find the best one for you and your friends to use. Hangouts, Whatsapp, Telegram and more are all battling it out for the number one spot. Let us know which IM client you think is best on Android and why.

DISCUSS
Jimmy McGee · May 25, 2015 at 12:00 pm · 3 comments

Android Factory Reset Security Flaw and More – XDA TV

Nvidia is releasing a 500Gb SHIELD TV Pro! That and much more news is covered by Jordan when he reviews all the important stories from this weekend. Included in this weekend's news is the announcement of an Android factory reset security flaw and be sure to check out the article talking about the Nexus Player getting TWRP. That's not all that's covered in today's video! Jordan covered the LG G4 First Impressions and Unboxing video from TK released this weekend...

XDA NEWS
Share This