clearRect() on CanvasDrag the sliders to change the X, Y postion and height width values for the clear rectangle.
x: Position from left edge of the canvas, y: Position from Top edge of the canvas, width : Width of the rectangle. height : Height of the rectangle. To clear full canvas gctx.clearRect(0, 0, my_canvas.width,my_canvas.height);Code to clear part of the Canvas. var my_canvas=$('#my_canvas').get(0) var gctx = my_canvas.getContext("2d"); gctx.beginPath() gctx.clearRect(20,20,50,50); gctx.stroke();
This article is written by plus2net.com team.
|