《android弧线的绘制》由会员分享,可在线阅读,更多相关《android弧线的绘制(2页珍藏版)》请在金锄头文库上搜索。
1、/画弧线p.setStyle(Paint.Style.STROKE);RectF oval1 = new RectF(150, 20, 280, 80);canvas.drawArc(oval1, 90, 180, true, p);此处绘制的是D沿底点旋转360度的形状!=publicRectF(float left, float top, float right, float bottom)Since:API Level 1Create a new rectangle with the specified coordinates. Note: no range checking is pe
2、rformed, so the caller must ensure that left = right and top = 360, the start angle is treated as start angle modulo 360.If the sweep angle is = 360, then the oval is drawn completely. Note that this differs slightly from SkPath:arcTo, which treats the sweep angle modulo 360. If the sweep angle is n
3、egative, the sweep angle is treated as sweep angle modulo 360The arc is drawn clockwise. An angle of 0 degrees correspond to the geometric angle of 0 degrees (3 oclock on a watch.)Parameters /使用自定义的oval画弧线ovalThe bounds of oval used to define the shape and size of the arc/弧线的起始角度,此角度按照正常的0360坐标轴划分,s
4、tartAngleStarting angle (in degrees) where the arc begins/弧线的角度,比如D的弧线角度就是180度,设置其实角度后,android是按照逆时针的方向开始绘图的sweepAngleSweep angle (in degrees) measured clockwiseuseCenterIf true, include the center of the oval in the arc, and close it if it is being stroked. This will draw a wedgepaintThe paint used to draw the arc