tags:

views:

51

answers:

2

Hopefully this is a simple one as I've been asking loads recently...

I am trying to draw the a white circle with the following code:

mPaint.setColor(0xFFFFFFFF);
canvas.drawCircle(x, y, radius, mPaint);

but it is being displayed as a solid disk, how do I get it to just display as an circular outline with a transparent centre?

I've had a look in the help and it makes no sense to me, probably because I'm not used to the drawing terms like stroke and dither. What's wrong with background and border eh?

-Frink

+1  A: 

I suspect you want:

mPaint.setStyle(Paint.Style.STROKE);

so that it doesn't do the filling. But then again, I've never used the Android API - this is really just a guess based on the docs :)

Jon Skeet
Nice one! Is Stroke a graphics term then? as I've never heard of it.Thanks tho,- Frink
FrinkTheBrave
A: 

Haven't worked with this myself, but looking at the SDK documentation you need to change the paint style. Take a look at this:

http://developer.android.com/reference/android/graphics/Paint.Style.html

Hope that helps.

Edit: hehe, what Jon said :)

LuCHEF