Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert png images to 9 patch in Android Studio

In android studio,you can edit 9 patches directly from with the IDE. But is it also possible to convert an png image to 9-patch using the IDE? (similar to the android 9-patch tool provided by the SDK).

like image 311
user2392650 Avatar asked May 17 '13 06:05

user2392650


People also ask

What is 9 patch PNG?

A 9 patch image is a regular png (. PNG) image which is needful for android app developers where they require to wrap any content within a background image without pixelating the background image.

What is the difference between a regular .png and a nine patch image?

The nine patch images have extension as. 9. png. It allows extension in 9 ways, i.e. 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes.

How do I create a 9 patch image in Photoshop?

Creating 9 patch background image using Photoshop:Draw the images in a regular way as you use to do in Photoshop. Make the 1px spacing around the image from all sides. And also make sure that the image doesn't have anything in this 1px area & has 100% transparency. Otherwise 9patch image will not work.


1 Answers

Well I don't think there is any tool in Android Studio but you can do this by Android Asset Studio

Android Asset Studio Simple Nine-patch Generator

This is a very handy tool to create simple 9 patch images for all dpi with a clean user interface.

like image 188
Vipul Purohit Avatar answered Sep 20 '22 15:09

Vipul Purohit