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.
Jimmy McGee · Jul 3, 2015 at 06:00 am · no comments

Droid Turbo Lollipop OTA, 2015 Moto G Leaked – XDA TV

Android Lollipop for the Droid Turbo has been released. That and much more news is covered by Jordan when he reviews all the important stories from this week. Included in this week's news is the announcement of the 2015 edition of the Moto G and be sure to check out the article talking about Android Lollipop for the Huawei Ascend Mate 2. That's not all that's covered in today's video! Jordan talks about the other videos released this week on...

XDA NEWS
Jack Jennings · Jul 3, 2015 at 04:12 am · no comments

EVLeaks Shows Off Possible BlackBerry Android Phone

It wasn't too long ago that we received reports of BlackBerry planning to use Android in their upcoming devices, although it wasn't confirmed how this would be implemented. The Canadian company has publicly announced that they 'remain committed to the BlackBerry 10 operating system', touting its strengths in security and productivity. Now, thanks to Evan Blass at EVLeaks, we have our first look at what one of these upcoming phones could look like.   The picture itself shows the bottom half of a design...

XDA NEWS
Faiz Malkani · Jul 2, 2015 at 08:41 pm · 1 comment

Mysterious GG1 Google Device Stops by FCC. Glass v2?

As the year progresses, we draw further away from Google's annual I/O conference, and closer to the time when the latest hardware from Mountain View is made available to the public. While I/O itself remains one of the most popular tech conferences, the hardware unveiling is a contrastively low-key post across social media, but nonetheless, remains an exciting and much awaited event. In the months leading up to the unveiling, a host of leaks take place, revealing various info about...

XDA NEWS
Share This