Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
72
rated 0 times [  74] [ 2]  / answers: 1 / hits: 34462  / 14 Years ago, sat, april 3, 2010, 12:00:00

I can't seem to find the function to remove a shape or path from the canvas after it has been created.



So I'm creating a bezier curve between 2 points with



beginPath();
bezierCurveTo();
stroke();
closePath();


How can I remove this from the canvas once it's been created? I need to be able to call the remove function via toggle() and blur(). I'm sure something exists for this...



Thanks in advance for any help!


More From » jquery

 Answers
87

Thanks for the great input to all of you - it helped me find the solution:



context.clearRect(x,y,w,h);


(link)



This will clear anything within that rectangle.



I found the method on the page I found while digging for ILog's answer to save/restore the context, and it's all on there. Thanks again.


[#97170] Wednesday, March 31, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarvisjovannia

Total Points: 127
Total Questions: 123
Total Answers: 101

Location: Netherlands
Member since Mon, Jun 7, 2021
3 Years ago
;