fillStyle() to select colour or gradient for lines and fills on CanvasDrag the sliders to change the X, Y position and height width values for the rectangle. Click the colour table to select a colour for fillStyle.
Options :
fillStyle = colour Specify a colour as shown in this demo fillStyle = gradient (object) Two types : createLinearGradient and createRadialGradient fillStyle = pattern (object) Image , video etc and to generate repeat image var my_canvas=$('#my_canvas').get(0) var gctx = my_canvas.getContext("2d"); gctx.beginPath(); gctx.fillStyle = 'red'; gctx.fillRect(20,20,50,50);
This article is written by plus2net.com team.
|