如何画透明中间有一个圆 [英] How to draw a circle with transparent middle

查看:202
本文介绍了如何画透明中间有一个圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望这是一个简单的,因为我一直在问最近加载...

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

我想画一个白色的圆具有以下code:

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

推荐答案

我怀疑你想要的:

mPaint.setStyle(Paint.Style.STROKE);

,这样它不会做馅。但话又说回来,我从来没有用过Android API - 这真的仅仅是基于文档猜测:)

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

这篇关于如何画透明中间有一个圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆