-1

The entire function is just stopping when ctx.DrawImage is called, this is all the information related to the call. I can't figure out what the issue is.

Additional information: I'm using DevExtreme so this is running on an 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;
}
Cody Jones
  • 424
  • 1
  • 5
  • 16

1 Answers1

0

You probably want to replace:

ctx.drawImage(showPicture, 0, 0, Canvas.width, Canvas.height);

With:

ctx.drawImage(smallPicture, 0, 0, Canvas.width, Canvas.height);
Cerbrus
  • 70,800
  • 18
  • 132
  • 147