) Android 9 patch Image

Source: Internet
Author: User

1. Features of the image in this format

2. Production Method

Features of a .9.png File

Compared with a traditional PNG image, a 9.png image consists of an edge of one pixel around the image. This edge is used to define the expandable exhibition area and content display area of the image.

Images in this format can be adjusted automatically in the android environment.

(1) developers are allowed to define extensible areas. When you need to extend an image to fill a region larger than the image itself, the content of the expanded area is extended.

(2) allow developers to define content display areas for displaying text or other content

As shown in:

The black lines on the left and above can be expanded.

The black line on the right and bottom is the content display area.

Ii. Create a .9.png Image

The Tools Folder of Android SDK provides the draw9patch. Bat tool for making images in this format.

Use this tool to open any image and place the cursor over the image. The main interface is shown in:

The area covered in black is uneditable (locked), and the edge of a pixel around it is editable.

Press and hold the left mouse button to draw a scalable exhibition area on the left and top sides.

Draw the content display area on the right and bottom. The result is as follows:

After the painting is complete, select File-> Save to save the file in .9.png format and use it in the android project.

Related Article

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.