Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var photo = new Image();
- photo.src = "./Ship1.png";
- photo.addEventListener('load', eventPhotoLoaded, false);
- function drawImage()
- {
- this.context.drawImage(photo, 0, 0, photo.width,photo.height, 0, 0, photo.width * currentScale, photo.height* currentScale);
- }
- theCanvas.addEventListener('click', function(evt) {
- var rect = this.theCanvas.getBoundingClientRect();
- x = evt.clientX - rect.left;
- y = evt.clientY - rect.top;
- //newGird is an array of cells containing R,G,B and Alpha values
- context.putImageData(newGird, x, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement