Stretchable bitmap image short guide – 9-patch/.9.png

  1. png9Add one pixel width transparent border to your image (png).
  2. On the top transparent line that we added, paint a black line and it would mark the stretchable zone on the x-axis.
  3. On the left transparent line that we added, paint a black line and it would mark the stretchable zone on the y-axis.
  4. On the right and bottom transparent lines that we added, paint a black lines and they would mark the content zone.
  5. Check that all the pixels that we’ve added around the image are transparent or completely black.
  6. You should add the markers after you’ve created the images for all dimensions.

More detailed and simple guide: http://radleymarx.com/blog/simple-guide-to-9-patch/

Draw9patch tool seperated from Android Studio: https://github.com/kshoji/draw9patch


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.