Android弧线的绘制

更新时间:2023-05-03 20:58:16 阅读: 评论:0

//画弧线
p.tStyle(Paint.Style.STROKE);
RectF oval1 = new RectF(150, 20, 280, 80);
canvas.drawArc(oval1, 90, 180, true, p);
此处绘制的是D沿底点旋转360度的形状!
==================================================================================================
public RectF (float left, float 警示教育片观后感 top, float right, float bottom)
Since: API Level 1
Create a new rectangle with the specified coordinates. Note: no range checking is performed, so the caller must ensure that left <= right and top <= bottom.
Parameters
       //弧线的位置设置中的左端X坐标
left The X coordinate of the left side of the rectagle

//弧线最高的点离画布的顶端的距离
top The Y coordinate of the top of the rectangle
//弧线的位置设置中的右端X坐标
right The X coordinate of the right side of the rectagle

//弧线最低的地方离画布的最高的点的距离
   
bottom The Y coordinate of the bottom of the rectangle 
==================================================================================================
aphics.Canvas.drawArc(RectF oval, float startAngle, float sweepAngle, boolean uCenter, Paint paint)
public void drawArc (RectF oval, float startAngle, float sweepAngle, boolean uCenter, Paint paint)
Since: API Level 1
Draw the specified arc, which will be scal重生复仇文 ed to fit inside the specified oval.
If the start angle is negative or >= 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 negative, the sweep angle is treated as sweep angle modulo 360
The arc is drawn clockwi. An angle of 0 degrees correspond to the geometric angle of 0 degrees (3 o'clock on a watch.)
Parameters
            //使用自定义的oval画弧线
oval The bounds of oval ud to define the shape and size of the arc
//弧线的起始角度,此角度按照正常的0~~360坐标轴划分,
startAngle Starting angle (in degrees) where the arc begins
//弧线的角度,比如D的弧线角度就是180度,设置其实角度后,android是按照逆时针的方向开始绘图的
sweepAngle
Sweep angle (in degrees) measured clockwi
uCenter
If true, include the center of the oval in the arc, and clo it if it is being stroked. This will draw a wedge
paint
The paint ud to draw the arc 

本文发布于:2023-05-03 20:58:16,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/854603.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:弧线   角度   旋转   画布   逆时针
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图