HTML5 Canvas
HTML5 Canvas The HTML <canvas> element is used to draw graphics on a web page. Canvas :- It is a rectangular area on an HTML page. Example, <canvas id = 'canvas1' width = '200px' height = '200px' style = 'border : 2px solid black;' ></canvas> Draw a rectangle <html> <head> <title> HTML5 Canvas </title> <head> <body> <canvas id = 'canvas1' width = '200px' height = '200px' style = 'border : 2px solid black;' ></canvas> <script> c1 = document.getElementById( 'canvas1' ); c1_x = c1.getContext( '2d' ); c1_x.fillStyle = 'orange' ; c1_x.fillRect( 50 , 100 , 200 , 100 ); </script> </body> </html> Draw a line <html> <head> <title> HTML5 Canvas </title> <head> <body> <canvas id = 'canvas2' width = ...
Comments
Post a Comment