title: Binary array to canvas
body: <p>I'm would like to load a jpeg image to a canvas from a binary array (currently trying with an Uint8Array). I've been looking all over the net for a solution but all I could find is converting the array to base64 and then loading the image which is not very efficient.</p>
  
  <p>Here is my code used for loading the image:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;canvas id="MainImage" width="756" height="600"&gt;Your browser doesn't support html5&lt;/canvas&gt;
  &lt;script type="text/javascript"&gt;
  _Request = new XMLHttpRequest();
  var url = "http://localhost/AAA/S.jpg";
  try {
     _Request.onreadystatechange = function() {
        if (_Request.readyState == 4 &amp;&amp; _Request.status == 200) {
           var downloadedBuffer = _Request.response;
           if (downloadedBuffer) {
              var binaryByteArr = new Uint8Array(downloadedBuffer);
           }
        }
        _Request.open('GET', url, true);
        _Request.responseType = 'arraybuffer';
        _Request.send();
  } catch (e) {
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I would like to load this processed array of the image to a canvas.</p>
  
  <p>This is just a sample, my original code receives a binary array with multiple jpeg images in a single array so other methods wont work.</p>
  
  <p>Any help would be appreciated</p>