Creating 9 patch image in Android Studio


Creating 9 patch PNG image (i.e .9.png image) is very easy but only few of us knows about it. Start with a PNG image, put it in any drawable folder in your project. Now follow the bellow mentioned steps.

Steps For converting PNG to 9 Patch PNG
  1. Rename your image file by right-click then Refactor > Rename and change the extension from .png to .9.png .
  2. Now as you will open the file you will see a window as
  3. On hovering over the icon you will see the vertical and horizontal lines. Drag and set these lines to set the part of the image which will stretch when views length increases like , ( you can zoom in and out for a clear view)
  4. The black lines in 5the above image shows the area to be stretched. You can also see the preview in the right side (marked in red box).
  5. And voilĂ !! You are ready to go.
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.


Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.

Hussein Zawia

Hussein Zawia

Co-founder, 24Dokan

Talk to Sales


Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home