问题描述
- 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; }
时间: 2024-12-30 02:19:47