[android-developers] Re: android draw circle
Hi,
http://developer.android.com/reference/android/graphics/Canvas.html
public void drawCircle (float cx, float cy, float radius, Paint paint)
Since: API Level 1
Draw the specified circle using the specified paint. If radius is <=
0, then nothing will be drawn. The circle will be filled or framed
based on the Style in the paint.
Parameters
cx The x-coordinate of the center of the cirle to be drawn
cy The y-coordinate of the center of the cirle to be drawn
radius The radius of the cirle to be drawn
paint The paint used to draw the circle
AND for your percentages -
public void drawArc (RectF oval, float startAngle, float sweepAngle,
boolean useCenter, Paint paint)
Since: API Level 1
Draw the specified arc, which will be scaled 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 clockwise. An angle of 0 degrees correspond to the
geometric angle of 0 degrees (3 o'clock on a watch.)
Parameters
oval The bounds of oval used to define the shape and size of the arc
startAngle Starting angle (in degrees) where the arc begins
sweepAngle Sweep angle (in degrees) measured clockwise
useCenter If true, include the center of the oval in the arc, and
close it if it is being stroked. This will draw a wedge
paint The paint used to draw the arc
Regards
On Jul 12, 10:17 pm, yanamala siddaiah <siddaiahforj...@gmail.com>
wrote:
> how to draw circle based on percentages.
>
> Here i am taking 4 different values all are 100% . a is 20% b is 30%
> like 4 things should occupy the circle. with different colors.
>
> pls send how to draw the circle
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home