cax icon indicating copy to clipboard operation
cax copied to clipboard

小程序的裁剪不行

Open ldwonday opened this issue 7 years ago • 0 comments

// 圆的半径
		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,图片正常显示!

ldwonday avatar Dec 26 '18 08:12 ldwonday