Android makes part of the stretched image material ---- 9 sister (9 patch) tool usage tutorial

Source: Internet
Author: User

9patch: make part of the stretched Image


Preface:

Everyone should have this experience. When we set a background for the button, because the button shows too much content,

This image is stretched and looks pretty bad. We usually want to zoom in and out the text.

The emergence of 9patch can easily solve this problem!


You can directly watch videos without reading text.

Link: 9patch basic tutorial



Where is 9patch?

Sdk directory ---> tools ---> draw9Patch. bat

After you double-click it, a cmd box will pop up, so you don't have to worry about it.

Ps: Don't worry about shutting down the cmd later!




<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> Vcd4kpggypsq508pb97pmow.vadi + cjxomz6i2btyv6rsqr340nc0psdttctnvmasow.vadm + CjxwPjxpbWcgc3JjPQ = "http://www.2cto.com/uploadfile/Collfiles/20140321/2014032112543695.png" alt = "\">

② After opening


③ Currently, Images cannot be operated directly because they are locked.


Remove the trench of the show lock below.

④ Check Show patches below


The current red/purple part is the current scaled area.

We leave around for a while, and there is an extra pixel line separated by white and black. This is our main operation object.

⑤ On the left or top of the outermost layer, click the pixel or pull, and click the top point on the left.



⑥ The Red Area (sb) is the scaled area, while the green area is a fixed size area.

If the range is Dorado, you can press and hold the shrit key, and the left mouse button to remove unnecessary points.


Save as * .9.png



When opening the image:

The lines on the left and above are normal. After the processing is completed, you can try it in the code. It's very simple. No code is provided here.



Summary:

The above is the usage tutorial of the 9patch tool, which is very simple,

You can try a few pictures at will.

Or the question, as readers may point out,

O (∩ _ ∩) O thank you!

Ps: That video is a bit noisy. The computer sound card is too junk. Sorry!


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.