HTML 5 Canvas Example
How do I make an html 5 canvas example?
What is a html 5 canvas example? How do you make a html 5 canvas example? This script and codes were developed by Victor Yan on 05 January 2023, Thursday.
HTML 5 Canvas Example - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>HTML 5 Canvas Example</title> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>
</head>
<body> <div class="container"> <h2>HTML 5 Canvas Example</h2> <div class="row"> <div class="col-sm-3"> <h4>Draw Line</h4> <canvas id="myCanvasLine" width="200" height="100" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag.</canvas> </div> <div class="col-sm-3"> <h4>Draw Circle</h4> <canvas id="myCanvas" width="200" height="100" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag.</canvas> </div> </div> <div class="row"> <div class="col-sm-3"> <h4>Draw Text</h4> <canvas id="myCanvasText" width="200" height="100" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag.</canvas> </div> <div class="col-sm-3"> <h4>Draw Stroke Text</h4> <canvas id="myCanvasStrokeText" width="200" height="100" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag.</canvas> </div> </div> <div class="row"> <div class="col-sm-3"> <h4>Draw Linear Gradient</h4> <canvas id="myCanvasGradient1" width="200" height="100" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag.</canvas> </div> <div class="col-sm-3"> <h4>Draw Radial/Circular Gradient</h4> <canvas id="myCanvasGradient2" width="200" height="100" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag.</canvas> </div> </div> <div>Provided by <a onclick="window.open('https://www.tipsoftheday.com.au')">Tips of the day</a></div>
</div> <script src="js/index.js"></script>
</body>
</html>
HTML 5 Canvas Example - Script Codes JS Codes
var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.beginPath(); ctx.arc(95,50,40,0,2*Math.PI); ctx.stroke(); var c = document.getElementById("myCanvasLine"); var ctx = c.getContext("2d"); ctx.moveTo(0,0); ctx.lineTo(200,100); ctx.stroke(); var c = document.getElementById("myCanvasText"); var ctx = c.getContext("2d"); ctx.font = "30px Arial"; ctx.fillText("Hello World",10,50); var c = document.getElementById("myCanvasStrokeText"); var ctx = c.getContext("2d"); ctx.font = "30px Arial"; ctx.strokeText("Hello World",10,50); var c = document.getElementById("myCanvasGradient1"); var ctx = c.getContext("2d"); // Create gradient var grd = ctx.createLinearGradient(0,0,200,0); grd.addColorStop(0,"red"); grd.addColorStop(1,"white"); // Fill with gradient ctx.fillStyle = grd; ctx.fillRect(10,10,150,80); var c = document.getElementById("myCanvasGradient2"); var ctx = c.getContext("2d"); // Create gradient var grd = ctx.createRadialGradient(75,50,5,90,60,100); grd.addColorStop(0,"red"); grd.addColorStop(1,"white"); // Fill with gradient ctx.fillStyle = grd; ctx.fillRect(10,10,150,80);
Developer | Victor Yan |
Username | tipsoftheday |
Uploaded | January 05, 2023 |
Rating | 3 |
Size | 2,026 Kb |
Views | 6,072 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Using Javascript to calculate age | 2,538 Kb |
Bootstrap 3 button groups | 1,510 Kb |
Make element focusable using tabindex | 1,593 Kb |
Bootstrap 3 Explained | 3,151 Kb |
TodoMVC using jQuery | 6,388 Kb |
QUnit example to verify calculate age function | 2,692 Kb |
Disable And Enable Input Elements In A Div Block Using jQuery | 2,033 Kb |
Bootstrap 3 navbar | 1,832 Kb |
Tooltip using plain Javascript | 1,825 Kb |
TodoMVC using AngularJS | 6,551 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Faces SVG animation | ScavengerFrontend | 2,957 Kb |
Sass Get Function | Lukewatts | 2,155 Kb |
A Pen by Eka Risyana | Risyana | 3,705 Kb |
Apple website | Jds317 | 1,835 Kb |
JS Beispiel getElementsByClassName 3 | HSZG-Frontend-Kurs | 1,988 Kb |
Static Image to Video Block | Grayghostvisuals | 4,864 Kb |
JavaScript constructors | Simboonlong | 2,415 Kb |
Css3 slide | Nakome | 3,190 Kb |
Modular Flip Card | Bbodine1 | 4,009 Kb |
Replace url via jquery | Serluk | 1,429 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!