Android Canvas Clip问题

我想裁剪出一个圆形区域,但是每次裁剪出的都是矩形。。求解··
这是代码:
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;
}
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问