weixin_42471603
weixin_42471603
2011-08-23 11:07
浏览 1.2k

android怎么在大圆圈里面绘制一个小圆圈?

求解答求解答求解答

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • iteye_18028
    iteye_18028 2011-08-23 11:32
    已采纳
    public void draw() {
        try {
            canvas = sfh.lockCanvas();
            canvas.drawColor(Color.WHITE);
            //设置透明度
            paint.setColor(0x70000000);
            //绘制大圆
            canvas.drawCircle(RockerCircleX, RockerCircleY, RockerCircleR, paint);
            paint.setColor(0x70ff0000);
            //绘制小圆
            canvas.drawCircle(SmallRockerCircleX, SmallRockerCircleY, 
                    SmallRockerCircleR, paint);
        } catch (Exception e) {
            // TODO: handle exception
        } finally {
            try {
                if (canvas != null)
                    sfh.unlockCanvasAndPost(canvas);
            } catch (Exception e2) {
            }
        }
    }
    
    点赞 评论
  • rainbow702
    rainbow702 2011-08-23 11:53

    canvas 类有个 drawCircle 方法,你先用大的半径画个圆,然后再用个小的半径画个圆,这样看起来就是大圆套着小圆了。

    点赞 评论
  • gundumw100
    gundumw100 2011-08-23 14:25

    这问题问的,就沒什么要求?

    点赞 评论

相关推荐