Android 9PNG Photo production process (graphic introduction) _android

Source: Internet
Author: User

In the process of Android development, we often because there is no good graphic image distortion, so that the interface looks inferior to many, sometimes we would like to drawable-hdpi,ldpi,mdpi in the image of different resolution, so that although it can effectively avoid image distortion, But such a problem is a picture resource-like whole project too big. So sometimes we want to be some pictures can stretch without losing a lot of good ah, this time we will think of Android for us to provide the 9.png format of the picture, the 9.png format image is an Android platform on the new creation of a stretch but the real thing.

Learned the production of this 9PNG picture, we later do the project when some because of different resolution and distorted picture can be used this way, the following look at its production process.

9PNG Production Tools We do not need to download, because the Android SDK has brought this tool, in the tools directory to find Draw9patch.bat, double-click will appear as shown:

Then drag the picture we want to make directly to the tool above, and it will appear like the following figure:



Put the mouse on a white border, click the left button do not put drag, will appear black line as shown:


Number 1th, the area to the right of the black strip where the picture is stretched vertically, only the area is stretched

Number 2nd the area covered by the black strip indicates that when the picture is stretched horizontally, only the area is stretched

The area of the 3rd black strip position to the left covers the area where the picture is displayed vertically (the main text area on the phone)

The area of the 4th black strip where the position is covered up indicates the area where the picture is displayed horizontally (mainly the text area on the phone)

The area covered with no black bar is the picture is stretched to remain unchanged (for example, if the four corners of the picture are curved, when the picture is arbitrarily stretched, the four corners of the arc will not change)

3 Red graphics area to the right to display the current stretch effect

Select a good area, click on the left file-"save 9-path, save the picture, suffix named Xxx.9.png." This makes it a success, and then you can throw this picture into the corresponding directory in drawable-hdpi.

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.