Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
164
rated 0 times [  166] [ 2]  / answers: 1 / hits: 45136  / 14 Years ago, wed, august 25, 2010, 12:00:00

I found that there's a clearRect() method, but can't find any to clear an arc (or a full circle).



Is there any way to clear an arc in canvas?


More From » html

 Answers
141

Nope, once you've drawn something on a canvas there is no object to clear, just the pixels you've drawn. The clearRect method doesn't clear a previously drawn object, it just clears the pixels in the space defined by the parameters. You can use the clearRect method to clear the arc if you know a rectangle which contains it. This will of course clear any other pixels in the area, so you'll have to redraw them.



Edit: MooGoo has given a much better answer below


[#95816] Monday, August 23, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
chase

Total Points: 78
Total Questions: 106
Total Answers: 93

Location: Comoros
Member since Tue, Mar 14, 2023
1 Year ago
chase questions
Thu, Mar 31, 22, 00:00, 2 Years ago
Thu, Jul 1, 21, 00:00, 3 Years ago
Sat, Dec 12, 20, 00:00, 4 Years ago
Mon, Sep 14, 20, 00:00, 4 Years ago
;