javascript - Accessing the <img> tag data -


I want to access the tag data so that I can use the JavaScript image processing to manipulate the server Can send to This is the & lt; Canvas & gt; can be done with:

For canvas support in IE:

/ P>
  • Create a canvas:
    var canvas = document.createElement ('canvas'); Canvas.setAttribute ('width', 150);
    canvas.SetAuthorBetter ('height', 150);

  • Get 2D references:
    var context = canvas.getContext ('2d');

  • Copy the image to the canvas:
    context.drawImage (document.getElementById ('your_image_id'), 0,0);

  • Modify you as you want:

  • Get the data URL with:
    canvas.toDataURL ()

That's it.

Also, see here:


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -