Android canvas draw常用方法收集
1.drawArc(RectF oval, float startAngle, float sweepAngle, boolean useCenter, Paint paint)
-
参数
- RectF oval 外切矩阵
- float startAngle 开始角度
- float sweepAngle 需要多少角度
- boolean useCenter 可以理解是否是封闭的圆弧 关于起点角度
- 起点3点钟方向(0度)
- 顺时针方向;6点是90度,9点是180度 以此类推…
- 逆时针方向;12点是-90度,9点是-180度 以此类推…
2. mPaint.setStrokeCap(Cap cap);
-
关于起点角度
- Paint.Cap.BUTT:无
- Paint.Cap.SQUARE:方形
- Paint.Cap.ROUND:圆形