Click here to Skip to main content
16,018,158 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello programmers (^_^)

In my work, I want a Browse button to insert an image in the browser
And save them in the form ?

The image appears at a specified width and height

by canvashtml in animate cc

What I have tried:

this.upload_button.addEventListener("click", fl_MouseClickHandler_3.bind(this));

function fl_MouseClickHandler_3() {
	var reader = new FileReader();
	reader.onload = function (event) {
		var dataUri = event.target.result,
			context = document.getElementById("mycanvas").getContext("2d"),
			img = new Image();

		img.onload = function () {
			context.drawImage(img, 100, 100);
		};
		img.src = dataUri;
		reader.readAsDataURL('file');
	}
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900