Skip to main content
CodeDeveloperOM
Inspiring
May 10, 2021
Question

components photo (HTML5 canvas)

  • May 10, 2021
  • 1 reply
  • 986 views

Hello everyone .. How are you?
I hope that you will be healthy and well-being and away from us Corona.

Please experts to help me .

 

Choose any image from the device ?

 

https://drive.google.com/drive/folders/1oFAxc49AuXqkGmPd-b4poiY4eu9ERQLa?usp=sharing

 

 

 

var root = this;
var putFile;

root.stop();

root.INS_PHO.addEventListener("click", function (e) {

	root.PHO_1,

	function (container) {
		if (bitmapA)
		container.removeChild(bitmapA);
		bitmapA = new createjs.Bitmap(e.target.result);
		setTimeout(function () {
		container.addChild(bitmapA);
		}, 0);
	};
});

root.uploadImage = function (container, loadCallback) {

	INS_PHO.addEventListener("change", function (e) {
		if (e.currentTarget.files && e.currentTarget.files[0]) {
			var reader = new FileReader();
			reader.onload = function (e) {
				loadCallback(container);
			}
			reader.readAsDataURL(e.currentTarget.files[0]);
		} else {}

	});
};

 

 

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    May 10, 2021

    what is it that you're trying to do?

     

    have the user select a local bitmap and then add that to the stage?

    CodeDeveloperOM
    Inspiring
    May 10, 2021

    @kglad  Yes, exactly 

    CodeDeveloperOM
    Inspiring
    May 12, 2021