can anyone help me in following scenario
I have one image on canvas.This image i have added from following code
var myCanvas = document.getElementById("the-canvas");
var myContext = myCanvas.getContext("2d");
var Img1 = new Image();
//Img.id = "myimg1";
Img1.src = 'checkbox.jpg';
//Img1.setAttribute("src", "images/checkbox.jpg");
//myContext.drawImage(Img1, 50, 50, 20, 20);
myContext.save();
//canvas.
//Img1.onload = function () { ctx.drawImage(Img1, 100, 100); }
Img1.onload = function () {
myContext.drawImage(Img1, 100, 100, Img1.width, Img1.height);
myContext.restore();
I need to move this image to new location on canvas using mouse or with help of touch.
can anyone guide me how to move this new added images within canvas.
I have tried one code in which content on canvas is disapper when i move images on canvas.
shreedhar