u011404046
名字随便取吧
2015-03-28 15:28

Android Canvas Clip问题

  • android

我想裁剪出一个圆形区域,但是每次裁剪出的都是矩形。。求解··
这是代码:
protected boolean drawChild(Canvas canvas, View child, long drawTime) {

    mRevealPath.reset();
    mRevealPath.addCircle(mCenterX, mCenterY, mRevealRadius, Path.Direction.CW);

    final int state = canvas.save();
    canvas.clipPath(mRevealPath);
    boolean isInvalidate = super.drawChild(canvas, child, drawTime);
    canvas.restoreToCount(state);
    return isInvalidate;
}
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答

为你推荐