camaro5520
camaro5520
2016-03-02 07:02

Android Canvas clipPath 画图锯齿问题

1
  • android

在Canvas上裁剪一个Path,将Bitmap画上去,出现锯齿问题。
Path path = new Path();
path.addCircle(left, top, radius, Path.Direction.CCW);
canvas.save();
canvas.clipPath(path);
Rect destRect = new Rect(left, top,
right, bottom);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setAntiAlias(true);
canvas.drawBitmap(bitmap, srcRect, destRect, paint);
canvas.restore();

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答