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.