cax
cax copied to clipboard
小程序的裁剪不行
// 圆的半径
const bgWidth = 640
const bgHeight = 758
const radii = 120
const imageWith = width
const imageHeight = width
const fontSize = 36
const innerRadii = 46
const stage = new Stage(bgWidth, bgHeight, 'myCanvas', this)
const bgBitmap = new Bitmap(bgSrc)
stage.add(bgBitmap)
const headBitmap = new Bitmap(this.headerImage, () => {
stage.update()
})
const clipHeadPath = new Graphics()
clipHeadPath.arc(bgWidth/2, marginTop + radii, innerRadii, 0, 2 * Math.PI)
headBitmap.clip(clipHeadPath)
stage.add(headBitmap)
stage.scale = 0.5
stage.update()
代码如上,死活裁剪不出来,去掉clipHeadPath,图片正常显示!