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:圆形
本文详细介绍Android中Canvas类的drawArc方法使用技巧,包括如何定义弧形的起始角度、绘制角度范围以及是否封闭,并解释了Paint类的setStrokeCap方法,用于设置绘制路径的端点样式。
4090

被折叠的 条评论
为什么被折叠?



