Android-XXX9.png file stretch without distortion everyone's attention

Source: Internet
Author: User

Release is 9.png:
All the functions that can be used to perform the job. However, the framework-res.apk \ res \ drawable-hdpi directory contains many xxxxxx.9.png images.

Do not think that this 9 is only a distinction between the names of PNG images. In fact, it is a special format, with some hands and feet on the basis of PNG images, in addition, you will not be able to see the details below ).

9.png is a new feature created on the Android platform.
Ghost pictures cannot be easily touched by the magic, but it doesn't matter. You'll see it later, and the android beautification master will be you.

 

After the ghost image is packaged, it turns into 21x21 pixels. Therefore, we should be aware of the size when making it.

When we make a 9.png image, you are still surprised to find that a picture of several kb or dozens of KB has become very small, usually as large as several hundred bytes, the system will certainly be smoother to load.

 

There is a draw9patch. bat under Android tools, which can convert a PNG image into a PNG consisting of 9 patches. The name is 9.png. Internal principle:Androidwill automatically process the .9.png file as a 9 patchfile, And the 9.png file is a PNG file. The special difference is that the circle around the box consists of 0x00000000 or 0 xffffffff, that is, a circle of black and white boxes, the place in the black box will be resize, the other four corners will not be resize, and the four upper and lower sides will be one-way resize. This is very advantageous for some PNG buttons, which can keep the rounded corner size around unchanged, while the center is enlarged. Draw9patch. bat is used to open a normal PNG image, and then click the center around it. Save it. You can see the zoom Effect on the right side. { Sorry, the android compiler has removed the border of 9.png from the break of 9.png from others' apk, so you need to use draw9patch. BAT to complete it yourself.} Then, in Android eclipse, put the 9.png image into drawable, and you can use it.

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.