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

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -