Android-----Paint cap Join comprehension, paint brush shape settings

Source: Internet
Author: User

Citation: http://www.2cto.com/kf/201501/370215.html

There is a lot of information on the Web, and the enumeration class cap joins inside the paint are not very thorough. Do a more in-depth study here.

First of all, the CAP, the comparative image explanation is used to control the last bit of graphics that our brushes leave when they leave the artboard, such as rectangles, circles, etc. Don't understand? Then look down.

First look at the source code:

/** * The CAP specifies the treatment for the beginning and ending of * stroked lines and paths.  The default is butt. */ Public enumCap {/** * The stroke ends with the path, and does not project beyond it. */Butt (0),          /** * The stroke projects out as a semicircle and the center at the * end of the path. */ROUND (1),               /** the stroke projects out as a square, with the center at the end * of the path. */SQUARE (2); PrivateCap (intnativeint) {                           This. Nativeint =nativeint; } Finalintnativeint; } 

Similar to the CAP, see the source code also shows that the default is miter, other specific shapes are difficult to understand. Then look at the picture:

MITER
ROUND
Bevel

The table above is the difference between the three styles, the difference is obvious, not repeat it here.

Reference:

* Setstrokecap (paint.cap Cap);         * When the brush style is stroke or fill_or_stroke, set the brush's graphic style, such as circular       style * cap.round, or square style        cap.square*          Setsrokejoin (Paint.join Join);        * Set how the shapes are combined when drawing, such as smoothing effects, etc.   

That is, if you want to use a circular brush, add the paint definition

    Paint.setstrokejoin (Paint.Join.ROUND);            Paint.setstrokecap (Paint.Cap.ROUND);

Android-----Paint cap Join comprehension, paint brush shape settings

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.