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:圓形