调用canvas.drawArc()时自定义视图边缘出错了

时间:2014-10-30 07:58:16

标签: android view

我想绘制一个圆形视图,然后像这样设置我的画面:

    mPaintForeground.setColor(mColorForeground);
    mPaintForeground.setStyle(Paint.Style.STROKE);
    mPaintForeground.setStrokeCap(Paint.Cap.ROUND);
    mPaintForeground.setStrokeWidth(20);
    mPaintForeground.setAntiAlias(true);

并绘制它:

   mBitmap = Bitmap.createBitmap((int) mRect.width(), (int) mRect.height(),
            Bitmap.Config.ARGB_8888);
   Canvas canvas = new Canvas(mBitmap);
   if (!loadingFinished) {
       canvas.drawArc(mRect, -90, mProgress, false, mPaintForeground);
   }

但我发现一些观点的边缘已被切断 edge of arc
那么如何控制弧中的半径长度?是mRect中的问题吗?

0 个答案:

没有答案