Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to download image in canvas javascript as named

  var canvas = document.getElementById("mcanvas");
  image = canvas.toDataURL("image/png", 1.0).replace("image/png", "image/octet-stream");
  var link = document.createElement('a');
  link.download = "my-image.png";
  link.href = image;
  link.click();
Comment

download canvas as image

//download canvas as image
function downloadCanvas() {
    let link = document.createElement("a");
    link.download = "image_name.png";
    link.href = canvas.toDataURL("image/png");
    link.click();
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: select a label from jquery using for attribute 
Javascript :: add classnames to body 
Javascript :: remove session storage 
Javascript :: how to convert seconds into days hours seconds js 
Javascript :: javascript isset 
Javascript :: nodejs command line arguments 
Javascript :: eslint console log 
Javascript :: remove last character javascript 
Javascript :: create react app netlify 
Javascript :: create element ns svg 
Javascript :: javascript store array in localstorage 
Javascript :: kill node process windows 
Javascript :: jquery add class 
Javascript :: beautifulsoup extract json from script elements 
Javascript :: items in center in native 
Javascript :: window.onload 
Javascript :: jquery get element id 
Javascript :: get last three characters of string javascript 
Javascript :: lowercase or uppercase all strings in array javascript 
Javascript :: nodejs ask for input 
Javascript :: format percentage javacsript 
Javascript :: get text inside element javascript 
Javascript :: how to open a new tab in react 
Javascript :: sequelize like search 
Javascript :: loop 
Javascript :: set text of dom element 
Javascript :: how to wait foreach javascript 
Javascript :: how to set session storage in javascript 
Javascript :: string to number angularjs 
Javascript :: console.log formdata 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =