Sunday, August 30, 2009

Drawing a Circle



There is no direct api in the graphics class to draw circle.
So for creating circle have to use eclipse or arc.

Circle Property
---------------------
1. Center point of the circle (x, y)
2. Radius r

Now circle can be drawn in the following ways
------------------------------------------------------------------


Graphics.drawEclipse(x, y, x + r, y, x, y + r, 0, 360);


Graphics.fillArc(x, y, r, r, 0, 360);
Graphics.drawArc(x, y, r, r, 0, 360);

No comments:

Post a Comment