title: Node.js node canvas show base64 image
body: <p>I'm currently transfering a <code>base64</code> image from a client to my server with <code>socket.io</code>. On the server, I want to render that <code>base64</code> image into my canvas. </p>
  
  <p>The code is:</p>
  
  <pre><code>function newSlide(slideImage){
    socket.broadcast.emit('newSlide', slideImage);
    var img = new Image;
    img.src = slideImage;
    ctx.drawImage(img, 0, 0);
  }
  </code></pre>
  
  <p>With that code, on the client everything is working, I can load the base64 image into a normal canvas, but on my server in <code>server.js</code> (where this code is), it's not working, I'm getting an error saying <code>Image is not defined</code> at the line <code>new Image</code>, when trying without the image-creation and just put in the <code>base64</code> string, it says image or canvas excepted.</p>
  
  <p>What's the problem with the image creation, why does it not work? And what can I do to make it working?</p>