Create a 9-patch custom stretch picture

Source: Internet
Author: User

One of the benefits of a scalable bitmap, 9-patch image resource, is that it can use a separate picture element for different UI elements, including buttons, drag bars, backgrounds, and any similar objects, screen backgrounds and button backgrounds that can also be used with this technique

Android comes with a tool, in the SDK Tools directory, there is a draw9patch.bat processing file, right-click, run as Administrator, File/open 9-patch, you can open a picture

Then, tick Show patches check box, in the picture above and to the left there will be a 1-pixel transparent border, you can use the mouse to drag the border to control the zoom range of the picture, you can preview the effect on the right

File/save 9-patch can be saved, save it as ****.9.png, you can use the bitmap as the general picture, @drawable/****;

At this point, the end.

Create a 9-patch custom stretch picture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.