Is there any way to convert an array of bytes into image data without using a canvas?
I am currently using something similar, but I think it can be done without a canvas, or am I mistaken?
var canvas = document.getElementsByTagName("canvas")[0]; var ctx = canvas.getContext("2d"); var byteArray = [ 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255,
http://jsfiddle.net/ARTsinn/swnqS/
Update
I already tried to convert it to base64-uri, but did not succeed:
'data:image/png;base64,' + btoa(String.fromCharCode.apply(this, byteArray));
Update 2
To split a question into a problem
The canvas itself is not the fact that oldIE (and yet) do not support it .... And libraries like excanvas or flashcanvas seem too bloated for this use case ...
source share