-1
當調用ctx.DrawImage時,整個函數剛剛停止,這是與調用相關的所有信息。我無法弄清楚問題是什麼。畫布圖像繪製失敗
其他信息: 我使用DevExtreme所以這是在Android OS
var Canvas = document.createElement("canvas");
var ctx = Canvas.getContext("2d");
Canvas.width=640;
Canvas.height=480;
var resultArray = [];
var workerCount = 0;
function onPhotoDataSuccess(imageData) {
smallPicture = document.getElementById('smallImage');
alert("1");
smallPicture.onload = function() {
alert("3");
ctx.drawImage(showPicture, 0, 0, Canvas.width, Canvas.height);
alert("4");
resultArray = [];
alert("5");
workerCount = 2;
alert("6");
barcodeNum = "";
DecodeWorker.postMessage({ ImageData: ctx.getImageData(0, 0, Canvas.width, Canvas.height).data, Width: Canvas.width, Height: Canvas.height, cmd: "normal" });
};
alert("2");
smallPicture.src = "data:image/jpeg;base64," + imageData;
}