About 13,500,000 results
Open links in new tab
  1. javascript - How to clear the canvas for redrawing - Stack Overflow

    After experimenting with composite operations and drawing images on the canvas I'm now trying to remove images and compositing. How do I do this? I need to clear the canvas for redrawing other ima...

  2. javascript - Resize HTML5 canvas to fit window - Stack Overflow

    Nov 3, 2009 · How can I automatically scale the HTML5 <canvas> element to fit the page? For example, I can get a <div> to scale by setting the height and width properties to 100%, but a …

  3. javascript - How do I get the coordinates of a mouse click on a canvas ...

    Sep 11, 2008 · What's the simplest way to add a click event handler to a canvas element that will return the x and y coordinates of the click (relative to the canvas element)? No legacy browser compatibility …

  4. javascript - How do I add a simple onClick event handler to a canvas ...

    Therefore, to get a click event on a canvas element (shape), you need to capture click events on the canvas HTML element and use some math to determine which element was clicked, provided you …

  5. javascript - How do I get the width and height of a HTML5 canvas ...

    How can i get the width and height of the canvas element in JavaScript? Also, what is the "context" of the canvas I keep reading about?

  6. javascript - HTML5 Canvas: Zooming - Stack Overflow

    Aug 6, 2010 · Is there any easy way how to zoom in and back out in canvas (JavaScript)? Basically I have a 400x400px canvas and I'd like to be able to zoom in with 'mousedown' (2x) and go back with …

  7. Loading an image onto a canvas with javaScript - Stack Overflow

    There are a few things: drawimage should be drawImage - note the capital i. Your getElementById is looking for an element with ID of canvas, but it should be test1. canvas is the tag, not the ID. Replace …

  8. Resize image with javascript canvas (smoothly) - Stack Overflow

    Oct 9, 2013 · I'm trying to resize some images with canvas but I'm clueless on how to smoothen them. On photoshop, browsers etc.. there are a few algorithms they use (e.g. bicubic, bilinear) but I don't …

  9. javascript - Scaling an image to fit on canvas - Stack Overflow

    Oct 13, 2016 · I have a form that allows a user to upload an image. Once the image is loaded, we perform some scaling on it in order to reduce its filesize before we pass it back to the server. To do …

  10. javascript - Getting mouse location in canvas - Stack Overflow

    May 31, 2014 · Is there a way to get the location mouse inside a <canvas> tag? I want the location relative to to the upper right corner of the <canvas>, not the entire page.