Android paint class

Source: Internet
Author: User
/**

* Paint class Introduction

*

* Paint is the paint brush, which plays an extremely important role in the drawing process. The paint brush mainly stores the color,

* Style and other painting information, specifying how to draw text and graphics, there are many ways to set the paint brush object,

* Generally, there are two types: one is related to drawing, and the other is related to text drawing.

*

* 1. Drawing

* Setargb (int A, int R, int g, int B );

* Set the color of the painting. A indicates transparency, R, G, and B indicates the color value.

*

* Setalpha (int );

* Set the transparency of the drawing.

*

* Setcolor (INT color );

* Set the color to be drawn, which is represented by a color value. The color value includes transparency and RGB color.

*

* Setantialias (Boolean aa );

* Setting whether to use the anti-aliasing function consumes a large amount of resources and slows down the drawing speed.

*

* Setdither (Boolean dither );

* Setting whether to use image jitter processing will make the color of the drawn image smoother and fuller, and the image clearer

*

* Setfilterbitmap (Boolean filter );

* If this parameter is set to true, the bitmap image is filtered out during the animation to accelerate the display.

* Speed. This setting item depends on dither and xfermode settings.

*

* Setmaskfilter (maskfilter );

* Set maskfilter. Different maskfilters can be used to implement filter effects, such as filtering and stereo *

* Setcolorfilter (colorfilter );

* Set the color filter to achieve the effect of changing colors that are not needed when drawing colors.

*

* Setpatheffect (patheffect effect );

* Set the effect of the draw path, such as drawing a line.

*

* Setshader (shader );

* Set the image effect. You can use shader to draw different gradient effects.

*

* Setshadowlayer (float radius, float dx, float dy, int color );

* Set the shadow layer under the image to produce the shadow effect. radius indicates the shadow angle. dx and Dy indicate the distance between the shadow on the X and Y axes, and color indicates the shadow color.

*

* Setstyle (paint. Style );

* Set the paint brush style to fill, fill_or_stroke, or stroke.

*

* Setstrokecap (paint. Cap CAP );

* When the paint brush style is stroke or fill_or_stroke, set the image style of the brush, such as the circle style.

* Cap. round, or square style cap. Square

*

* Setsrokejoin (paint. Join join );

* Set the combination of various images during painting, such as smooth effects.

*

* Setstrokewidth (float width );

* When the paint brush style is stroke or fill_or_stroke, set the width of the paint brush.

*

* Setxfermode (xfermode );

* Sets the processing method for overlapping images, such as merge, intersection, or union. It is often used to make the eraser erasure effect.

*

* 2. Text Rendering

* Setfakeboldtext (Boolean fakeboldtext );

* Simulate bold text and set it to a small font.

*

* Setsubpixeltext (Boolean subpixeltext );

* Setting this parameter to true will help display the text on the LCD screen.

*

* Settextalign (paint. Align align );

* Set the alignment direction of the drawn text

*

* Settextscalex (float scalex );

* You can set the zoom ratio on the X axis of the drawn text to stretch the text.

*

* Settextsize (float textsize );

* Set the font size of the drawn text.

*

* Settextskewx (float skewx );

* Set italic text. skewx is a skewed radian.

*

* Settypeface (typeface );

* Set the typeface object, that is, the font style, including bold, italic, and linefeed, non-linefeed, etc.

*

* Setunderlinetext (Boolean underlinetext );

* Set the underlined text effect.

*

* Setstrikethrutext (Boolean strikethrutext );

* Set the effect of strikethrough.

*

*/

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.