Drawing Circles

More fun can be had by drawing circles, filled or stroked, or both: Canvas.drawCircle(float centerX, float centerY, float radius, Paint paint);

The first two arguments specify the coordinates of the center of the circle, the next argument specifies the radius in pixels, and the last argument is again a Paint instance. As with the Canvas.drawRectangle() method, the color and style of the Paint will be used to draw the circle.

One last thing of importance is that all these drawing methods will perform alpha blending. Just specify the alpha of the color as something other than 255 (0xff), and your pixels, lines, rectangles, and circles will be translucent.

0 0

Post a comment