dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: HTML5 canvas- use a function to clear an image that has been drawn to the canvas

  1. #1
    Join Date
    Apr 2012
    Posts
    16

    HTML5 canvas- use a function to clear an image that has been drawn to the canvas

    Hi,

    I have a JavaScript function that draws an image (which is being used as a button), to my canvas... When the image is clicked, another function is called, which draws the next set of elements to the canvas.

    The problem I have, is that the image drawn by the first function is still on the canvas when the elements drawn by the second function appear. I want to include a call to canvas.remove(image drawn by first function), at the start of my second function, but I'm not sure how I would do this- what the command I would need to call is, or the syntax of it.

    Can anyone help?

  2. #2
    Join Date
    Feb 2012
    Location
    Bokaro Steel City (Jharkhand), India!
    Posts
    194
    Check this: HTML5 Canvas Tutorials

    (...may be it shall help!)

  3. #3
    Join Date
    Apr 2012
    Posts
    16
    Thanks, I managed to get it working.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles