Android Paint class Method description

Source: Internet
Author: User

* Paint Class Introduction

*

* Paint is a brush, plays a very important role in the drawing process, the brush mainly preserves the color,

* style, such as drawing information, specify how to draw text and graphics, brush objects have many settings methods,

* Can be broadly divided into two categories, one is related to graphic drawing, the other is related to text rendering.

*

* 1. Graphic drawing

* SETARGB (int a,int r,int g,int b);

* Set the color to be drawn, a for transparency, and r,g,b for the color value.

*

* SETALPHA (int a);

* Set the transparency of the drawing drawing.

*

* SetColor (int color);

* Sets the color of the drawing, which is represented by a color value that includes transparency and RGB colors.

*

* Setantialias (Boolean AA);

* Set whether anti-aliasing is used, consumes large resources, and the drawing speed slows down.

*

* Setdither (Boolean dither);

* Set whether to use Image jitter processing, will make the picture color more smooth and full, image clearer

*

* Setfilterbitmap (Boolean filter);

* If the item is set to True, the image will filter out the optimized operation of the bitmap image during animation to speed up the display

* Speed, this setting depends on the settings of dither and Xfermode

*

* Setmaskfilter (Maskfilter maskfilter);

* Set Maskfilter, you can use different maskfilter to achieve the effect of filter, such as filter, stereo, etc. *

* Setcolorfilter (Colorfilter colorfilter);

* Set the color filter to achieve a color-free conversion effect when drawing colors

*

* Setpatheffect (Patheffect effect);

* Set the effect of drawing path, such as point drawing line, etc.

*

* Setshader (Shader Shader);

* Set the image effect, use shader can draw a variety of gradient effect

*

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

* Set the shadow layer below the graph, create a shadow effect, radius is the angle of the shadow, DX and dy are the distance from the shadow on the x-axis and the y-axis, color is the shade of the shadow

*

* SetStyle (Paint.style Style);

* Set the style of the brush for Fill,fill_or_stroke, or STROKE

*

* SETSTROKECAP (Paint.cap Cap);

* When the brush style is stroke or fill_or_stroke, set the brush's graphic style, such as the circle 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.

*

* Setstrokewidth (float width);

* When the brush style is stroke or fill_or_stroke, set the thickness of the brush

*

* Setxfermode (Xfermode xfermode);

* Set the process of drawing overlap, such as merging, taking intersection or union, often used to make eraser effect.

*

* 2. Text rendering

* Setfakeboldtext (Boolean fakeboldtext);

* Simulation to implement bold text, set in small font effect will be very poor

*

* Setsubpixeltext (Boolean subpixeltext);

* Setting this to True will help to display the text on the LCD screen

*

* SetTextAlign (paint.align Align);

* Set the alignment direction of the drawing text

*

* Settextscalex (float ScaleX);

* Set the scale of the drawing text x axis, can achieve the effect of the text stretching

*

* Settextsize (float textSize);

* Set font size for drawing text

*

* SETTEXTSKEWX (float skewx);

* Set italic text, skewx to oblique radians

*

* Settypeface (Typeface Typeface);

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

*

* Setunderlinetext (Boolean underlinetext);

* Set underlined text effects

*

* Setstrikethrutext (Boolean strikethrutext);

* Set the effect with strikethrough

*

(Transferred from: http://www.cnblogs.com/-OYK/archive/2011/10/25/2223624.html)

Android Paint class Method description

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.