Drawable
程序员文章站
2022-06-14 10:53:51
...
//设置去锯齿
paint.setAntiAlias()
//设置线条宽度
paint.setStrokeWidth:
canvas.drawCircle(40,40,30,paint)//画圆
//public void drawCircle (float cx, float cy, float radius, Paint paint)
/*
cx The x-coordinate of the center of the cirle to be drawn
cy The y-coordinate of the center of the cirle to be drawn
radius The radius of the cirle to be drawn
paint The paint used to draw the circle*/
canvas.drawRect (float left, float top, float right, float bottom, Paint paint)//矩形
//画多边形
path.moveTo(float x, float y)
//Set the beginning of the next contour to the point (x,y).
path.lineTo(float x, float y)
//Add a line from the last point to the specified point (x,y).
path.Close();
/*Close the current contour. If the current point is not equal to the first point of the contour,
a line segment is automatically added.*/
canvas.drawPath (Path path, Paint paint)
/*--------------设置渐变器后绘制-------------------*/
Shader shader=public LinearGradient (float x0, float y0, float x1, float y1, int[] colors, float[] positions, Shader.TileMode tile)
paint.setShader(shader);
//设置阴影层
paint.setShaderLayer();
---------------------Path类-----------------------------
PathEffect effects=new PathEffect();
effects[1]=new CornerPathEffect(10);
effects[2]=new
/*
public CornerPathEffect (float radius)
Transforms geometries that are drawn (either STROKE or FILL styles) by replacing any sharp angles between line segments into rounded angles of the specified radius.
Parameters
radius Amount to round sharp angles between line segments. */
/*public DashPathEffect (float[] intervals, float phase)
The intervals array must contain an even number of entries (>=2), with the even indices specifying the "on" intervals, and the odd indices specifying the "off" intervals. phase is an offset into the intervals array (mod the sum of all of the intervals). The intervals array controls the length of the dashes. The paint's strokeWidth controls the thickness of the dashes. Note: this patheffect only affects drawing with the paint's style is set to STROKE or FILL_AND_STROKE. It is ignored if the drawing is done with style == FILL.
Parameters
intervals array of ON and OFF distances
phase offset into the intervals array
*/
上一篇: kafka2.3集群搭建
下一篇: kafka-0.10.2.2集群搭建
推荐阅读
-
Android5.0之后的materialDesign设计的mipmap与普通的drawable的对比讲解
-
帧动画Drawable Animation入门_html/css_WEB-ITnose
-
5、控件美化(drawable使用)
-
EditText 下划线背景 drawable 实现方式
-
Android 图片Bitmap,drawable,res资源图片之间转换
-
Binary XML file line #19: <item> tag requires a ‘drawable‘ attribute or child tag defining a drawabl
-
Android自定义Drawable实现圆形和圆角
-
Android自定义Drawable实现圆角效果
-
Android开发使用Drawable绘制圆角与圆形图案功能示例
-
Android自定义Drawable实现圆形和圆角