Android. 9.png image Production and use

Source: Internet
Author: User

The. 9.png picture is actually a PNG format picture, but it is more than the normal PNG image outside the 1px (pixel) border, the other is the use of this format of the picture can achieve the background adaptive size and without losing the real effect. For example, some controls after the screen switch after the appearance of the control is distorted, or some of the picture as the control background is also distorted, which makes people very depressed. Fortunately. 9.png images can provide these required features.


Steps to make a use:

1, make your own PNG picture, must be a PNG image. Can own PS production, also can unzip other application apk file, with the picture resources inside, Android system also has the picture resources can use.
2. Locate the Draw9patch.bat file in the Android-sdk-windows\tools directory, then open it and drag the PNG image you want to process. or file-to-Open 9 patches.




Upper black line: Transverse stretch area, must be drawn, stretching is transverse stretching, as the right area the second stretch is the effect of transverse stretching
Left black line: The longitudinal stretch of the area, must be drawn, stretching is a longitudinal stretch, such as the right area the first stretch is the effect of a longitudinal stretch
Black line below: Optional, horizontal content display area
Right black line: optional, vertical content display area

3, note that the black line must be continuous, if you feel bad painting, press shift+ the left mouse button to wipe it out, and then new painting. After painting click File-->save 9-patch Save, effect such as


4, the next need to use in the program, the picture can be put into the drawable, and other pictures use no difference, the only magic is adaptive, not distortion.

Android. 9.png image Production and use

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.