Statement:
Void android. graphics. Path. arcTo (RectF oval, float startAngle, float sweepAngle );
This method draws an arc path.
The first parameter is of the RectF type. What does this parameter do?
First, how does this arc come from? It is to draw an ellipse first, and then truncate a part of the Shape on it. This figure is naturally an arc. So how is this ellipse determined? This is the role of this rectF parameter.
:
After the rectangle is given, the system can calculate the center of the rectangle, and draw an elliptic from the center of the rectangle.
After getting this elliptic, we can take a part of the line and get the final arc. How is this part intercepted?
This is expressed by the following two parameters.
StartAngle is the starting angle. This is easy to understand, but where is the 0-degree line, and in which direction is the rotation of the positive angle degree? The following is a graphic display:
The red line shown in the figure is a 0-degree line.
StartAngle is the starting degree. What does sweepAngle mean?
SweepAngle refers to the degree of rotation, that is, the degree of rotation starting from startAngle. If sweepAngle is a positive number, it is rotated clockwise. If it is a negative number, it is rotated counterclockwise.
For example: startAngle = 0; sweepAngle = 90:
The arc of the red part is the final arc...