diff --git a/pages/component/canvas/canvas.uvue b/pages/component/canvas/canvas.uvue index f56e71be9a3a811778e4f7bf0290b5af02b57a1d..602b9ecac838bd1a6e6569f289f357570d732339 100644 --- a/pages/component/canvas/canvas.uvue +++ b/pages/component/canvas/canvas.uvue @@ -94,16 +94,18 @@ // #ifdef WEB context.toBlob((blob : Blob) => { this.testToBlobResult = (blob.size > 0 && blob.type == 'image/jpeg') - }, 'image/jpeg', 0.95) + }, 'image/jpeg', 0.95); + this.testToDataURLResult = this.canvasContext!.toDataURL().startsWith('data:image/png;base64') // #endif - this.testCanvasContext = true } }) }, onReady() { // TODO app-android 需要延迟调用 + // #ifdef APP this.testToDataURLResult = this.canvasContext!.toDataURL().startsWith('data:image/png;base64') + // #endif // 同步调用方式,仅支持 app/web // let canvas = uni.getElementById("canvas") as UniCanvasElement