Andriod platform "Point Nine" 9.png design introduction

Source: Internet
Author: User

"Point Nine" is a special picture form in the application software development of the Andriod platform, the file name extension is:. 9.png

The smart phone has the function of automatic horizontal screen, the same interface will be in the mobile phone (or tablet computer) in the direction of the sensor in different parameters to change the direction of the display, in the interface to change the direction of the interface of the graphics will be due to the long width of the changes resulting in stretching, resulting in distorted graphics distortion.

We all know that the Android platform has many different resolutions, and that many of the control's Chettu files are blurred and distorted when they are enlarged and stretched.

OK, using the dot nine PNG technology under the Android platform, you can stretch the picture both horizontally and vertically to achieve the perfect display at multiple resolutions.

"General tensile and point nine tensile effects contrast"

The contrast is obvious, after using point nine, can still retain the image of the gradient texture, and roundness of the fineness.

From that we can also understand why it's called "Dot nine png", in fact, the equivalent of a PNG map into 9 parts (nine Sudoku), respectively, 4 corners, 4 edges, and an intermediate area, 4 corners are not to pull up, so you can always keep the rounded corners of the clear state, and 2 water The flat and vertical edges are only horizontal and vertical stretching, so there is no case where the edges will be drawn, only the middle with the area specified by the black line to stretch. The result is that the picture doesn't get out of shape.

Two. " The production method of point nine "

Method 1: Use the "draw9patch" tool to draw the following process

1. Installation Tools

First you need to install your own computer in the default directory of Java in the system. Do not install Java students can search in Baidu: jdk-6u20-windows-i586, installation package size of 80M or so.

Then, using the Andriod emulator-android-sdk-windows, open the "Draw9patch.bat" file in the Sdk/tools directory, and the load window appears:

2. Import and edit

Drag a PNG picture to the window

The following figure automatically enters the editing interface. The diagram describes the content and functional annotations for each area.

The view to the right of the preview finds that the edge of the picture is in the normal stretch state.

Now we click the left button on the edge of the picture to draw the black line, which is the part where the picture needs to be stretched. The following figure, 4 black lines are commented.

If the error is more than painted parts, you can hold down the SHIFT key while clicking the left mouse button to erase.

As shown in the picture, three kinds of tensile results have been perfectly displayed, we have achieved the desired tensile effect, assuming that this is a form with display text, then the area of text display, the program will also control the corresponding range of the black line.

These pictures, including the opposite sex (irregular graphics) picture, can also be achieved by the point nine PNG vertical natural stretching.

"Draw9patch.bat Other Feature description"

②show Lock: Show non-painted areas

②show Patches: Preview the Extensible Sudoku in this plot area (pink represents an extensible area)

③show patches: Highlighted areas in the Preview view (purple area)

④show Bad patches: Add a red border in the Sudoku area for four weeks, which may produce artificial traces when the image is extended. If you eliminate all bad Sudoku, the visual consistency of the extended view will be maintained.

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.