How to render JPEG/PNG file data contained in Javascript variable? Is it possible ? What javascript libraries needed ? Browser in use is FF / IE.
Thanks
How to render JPEG/PNG file data contained in Javascript variable? Is it possible ? What javascript libraries needed ? Browser in use is FF / IE.
Thanks
Modern browsers support inline images. So you could convert the binary data to a base64 encoded string and then append it to the DOM:
var img = document.createElement('img');
img.src = 'data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub//ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7';
img.width = '16';
img.height = '14';
document.body.appendChild(img);