Solved
Drawing an image with the HTML Canvas
I'm trying to draw an image on the HTML Canvas, but it's not working. I put this into JSFiddle and, with one additional line of code, it works. However, this line of code doesn't help me in Vuforia Studio. What am I missing?
$scope.drawLargeInstructionImage = () => {
let c = document.createElement("canvas");
let ctx = canvas.getContext("2d");
let slideLeftSidePadding = 25;
let slideTopPadding = 22;
let slideWidth = 694;
let slideHeight = 344;
let slide = new Image();
slide.src='app/resources/Uploaded/InstructionBackgroundSlide.png';
console.log(slide);
slide.onload = () => {
ctxtwo.drawImage(slide, slideLeftSidePadding, slideTopPadding, slideWidth, slideHeight);
};
document.body.appendChild(ctx.canvas); //the line of code that fixes the problem in JSFiddle
tml3dRenderer.setTexture("LargeInstructionImage", c.toDataURL());
}
