开发者

How to draw a transparent circle?

I'm trying to draw a tra开发者_开发问答nsparent circle, but it just doesn't work.

when I'm drawing a bitmap it works, but a circle doesn't become transparent.

Here's my code in short:

Paint paint = new Paint();
paint.setAlpha(125);
canvas.drawBitmap(bitmap, sourceRect, destRect, paint);  // this works fine

canvas.drawCircle(x, y, radius, paint);   // the circle is drawn but not transparent


I found it.

paint.setAlpha must come after paint.setColor

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜