diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-components-offscreencanvas.md b/zh-cn/application-dev/reference/arkui-ts/ts-components-offscreencanvas.md index b8ff815c0bcc60edef8e933b718dd81c49d2a80d..aac5a3287fc99a8839acd8101015233008c85287 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-components-offscreencanvas.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-components-offscreencanvas.md @@ -55,7 +55,7 @@ struct OffscreenCanvasPage { .onReady(() => { var offContext = this.offCanvas.getContext("2d", this.settings) offContext.fillStyle = '#CDCDCD' - offContext.fillRect(0, 0, offCanvas.width, 150) + offContext.fillRect(0, 0, this.offCanvas.width, 150) var image = this.offCanvas.transferToImageBitmap() this.context.setTransform(1, 0, 0, 1, 50, 200) this.context.transferFromImageBitmap(image) @@ -89,7 +89,7 @@ struct OffscreenCanvasPage { .onReady(() => { var offContext = this.offCanvas.getContext("2d", this.settings) offContext.fillStyle = '#CDCDCD' - offContext.fillRect(0, 0, 100, offCanvas.height) + offContext.fillRect(0, 0, 100, this.offCanvas.height) var image = this.offCanvas.transferToImageBitmap() this.context.setTransform(1, 0, 0, 1, 50, 200) this.context.transferFromImageBitmap(image)