Use .arc
to create a circular stroke and then use .clip()
to make that the current clipping region.
Then you can use .clearRect()
to erase the whole canvas, but only the clipped area will change.
More Related Contents:
- How to clear the canvas for redrawing
- HTML5 Canvas Resize (Downscale) Image High Quality?
- Resize image with javascript canvas (smoothly)
- HTML5 Canvas camera/viewport – how to actually do it?
- Capture frames from video with HTML5 and JavaScript
- How to use Google fonts in Canvas when Drawing DOM objects in SVG?
- addEventListener for keydown on Canvas
- Load image from url and draw to HTML5 Canvas
- Save canvas as jpg to desktop [duplicate]
- HTML canvas – drawing disappear on resizing
- canvas getContext(“2d”) returns null
- How to detect shape on a transparent canvas?
- HTML5 Canvas API – formatting individual words with italics
- Scaling an image to fit on canvas
- True Isometric Projection with HTML5 Canvas
- How do I add a simple onClick event handler to a canvas element?
- Resize HTML5 canvas to fit window
- How To Save Canvas As An Image With canvas.toDataURL()?
- Simulation background-size: cover in canvas
- HTML5 Canvas to PNG File
- Cross-origin data in HTML5 canvas
- Uploading ‘canvas’ image data to the server
- HTML5 canvas ctx.fillText won’t do line breaks?
- How can I stop the alpha-premultiplication with canvas imageData?
- Is it possible to programmatically detect size limit for data url?
- What is the current state of the art in HTML canvas JavaScript libraries and frameworks? [closed]
- Detect if user clicks inside a circle
- Javascript function to Rotate a base 64 image by X degrees and return new base64
- how to draw a wheel of fortune?
- How can I animate the drawing of text on a web page?