Draw a hollow circle on an Android Canvas

有些话、适合烂在心里 提交于 2019-12-06 12:00:59
GhostDerfel

As asked :) The solution is to set the style to be Paint.Style.STROKE

Hollow Circle in canvas.

Bitmap bitmap=Bitmap.createBitmap(500,500, Bitmap.Config.ARGB_8888);
    Canvas canvas=new Canvas(bitmap);
    //canvas.clipPath(,Region.Op.DIFFERENCE);
    Paint paint=new Paint();
    paint.setColor(Color.RED);
    paint.setStrokeWidth(140);
    paint.setStyle(Paint.Style.STROKE);
    canvas.drawCircle(250,250,150,paint);
    imageView.setImageBitmap(bitmap);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!