I am trying to load a picture into HTML5 Canvas.
when i use a URL to load the image everything works fine, but if i put the image on the local drive and point to it, nothing happens.
note: when i use a regular tag, everything works fine and the image is loaded.
here is the code:
var canvas = document.getElementById("rightSide"); var context = canvas.getContext("2d"); var imageObj = new Image(); imageObj.src = "cloud.gif"; context.drawImage(imageObj, 650, 55, 93, 104);<
canvas id=”rightSide” width=”800px” height=”800″>
thanks.
Try something like this.