Tuesday, March 27, 2012

[android-developers] drawing an empty circle

Hi all,

I am here trying to draw a circle using Canvas class, but my requirement is just to draw the boundary/circumference of the circle.
The remaining part of the circle should be empty.
 For eg, I am drawing a circle of yellow color, just want to show the yellow boundary, else should be empty.

Paint mPaintYellow = new Paint();
mPaintYellow.setColor(0xFFFFFF00);
 mPaintYellow.setStrokeWidth(1);

 mCanvas.drawCircle(mScreenCentreX, mScreenCentreY, mBoundaryRadius_inner, mPaintYellow);

I have used the above code to draw the circle, which is giving the completely colored circle.


I have one more alternative for achieving that, that is, drawing another circle with the same color as that of the background, with reduced radius than that of the yellow circle. But in this case, I need to have draw two circles for showing just the boundary.
As well as it seems somewhat unapropriate for doing so.

Is there any other alternative which may be helpful to do what I want.
I will surely be glad to apply your suggestions.

With Regards,
Narendra..

--
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

No comments:

Post a Comment