Paint is a brush, in the drawing process played an extremely important role, the brush mainly save the color, * style, such as drawing information, specify how to draw text and graphics, brush objects have many settings, * can be broadly divided into two categories, a kind of drawing related to the graph, a class of text rendering related. 1. Graphic drawing Setargb (int a,int r,int g,int b); Sets the color of the drawing, a for transparency, and r,g,b for the color value. Setalpha (int a); Sets 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); Setting whether to use anti-aliasing will consume large resources and will slow down drawing graphics. Setdither (Boolean dither); Setting whether to use image dithering will make the painted picture more smooth and full, the image clearer Setfilterbitmap (Boolean filter); If the key is set to true, the image will filter out the optimized operation of the bitmap image during animation and speed up the display, 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 the filter, such as filtering, stereoscopic and so on * Setcolorfilter (Colorfilter colorfilter); Set the color filter, you can achieve the color-free transformation effect Setpatheffect (Patheffect effect) when drawing colors; Sets the effect of drawing paths, such as Setshader (Shader Shader), such as point drawing lines; To set the image effect, use shader to draw a variety of gradient effects 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 of the shadow on the x-axis and the y-axis, and color is the setStyle of the Shadow (Paint.style Style); Sets 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 circular style cap.round, or square style cap.square setsrokejoin (Paint.join Join); Set the drawing when the combination of various shapes, such as smoothing effect, such as setstrokewidth (float width); When the brush style is stroke or fill_or_stroke, set the brush's thickness setxfermode (xfermode xfermode); Sets the way in which graphics overlap, such as merging, taking intersection or union, often used to create eraser effects 2. Text Draw Setfakeboldtext (Boolean fakeboldtext); The simulation of the implementation of bold text, set in the small font effect will be very poor Setsubpixeltext (Boolean subpixeltext); Setting this to True will help the text display on the LCD screen settextalign (paint.align Align); Sets the alignment direction of the drawn text Settextscalex (float ScaleX); Set the scale of the drawing text x axis, can achieve the effect of the text stretching settextsize (float textSize); Sets the font size of the drawn text settextskewx (float skewx); Sets italic text, skewx to oblique radian settypeface (Typeface Typeface); Set typeface object, that is, font style, including bold, italic and liner body, non-liner body, such as Setunderlinetext (Boolean underlinetext); Sets the underline text effect Setstrikethrutext (Boolean strikethrutext); Set the effect with strikethrough
Android-paint Class Introduction