I have an html canvas, like so:
//output is a base64string of image data
var oldImage = new Image();
oldImage.onload = function () {
var resizeRatio = oldImage.width / 500;
var height = oldImage.height / 2;
};
oldImage.src = output;
var standardizedCanvas = document.createElement("canvas");
standardizedCanvas.setAttribute("width", "500px");
standardizedCanvas.setAttribute("height", height + "px");
standardizedCanvas.getContext("2d").drawImage(oldImage, 0, 0, frontCanvas.width, frontCanvas.height);
So I can read the image into the canvas, and then get the Image Data. But what does that really give me? I need a byte[]
from the canvas, which contains the image data, so really I want to convert a base64
string into a byte[]
. Am I on the right track, or....?