绘制圆的android

问题描述:

我怎样才能画出使用Android SDK中两点之间圈子?

How can i draw circle between two points using the android SDK?

创建位图,然后绘制它的画布上,然后将此位添加到一个ImageView的按钮或任何你想要的。

Create A bitmap then draw on its canvas and then add this bitmap to an imageview or button or whatever you want.

创建位图:

    Bitmap bmp = Bitmap.createBitmap(width, height, config);

绘制位图的画布上

Draw on the bitmap canvas

    Canvas c = new Canvas(bmp);
    c.drawCircle(cx, cy, radius, paint)

设置的ImageView

setting to imageview

    img.setBackgroundDrawable(new BitmapDrawable(bmp));