-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
40 lines (35 loc) · 1.11 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE HTML>
<html>
<head>
<title> Meme Generator </title>
<meta charset="utf-8">
</head>
<body>
<!-- <canvas id="c" width="200" height="200"></canvas> -->
<canvas id="c" width="500" height="500"></canvas>
<script>
var c = document.querySelector( "#c" );
var ctx = c.getContext( "2d" );
/*
var image = new Image();
image.onload = function() {
console.log( "loaded image" );
ctx.drawImage( image, 0, 0, c.width, c.height );
var savedImage = c.toDataURL();
window.open( savedImage );
}
image.src = "images/saurabh.jpg";
*/
ctx.fillRect( 100, 100, 100, 100 );
ctx.strokeRect( 50, 50, 50, 50 );
// We are about to draw a new shape
ctx.beginPath();
ctx.moveTo( 10, 10 );
ctx.lineTo( 50, 50 );
ctx.lineTo( 50, 10 );
ctx.lineTo( 10, 10 );
// ctx.fill();
ctx.stroke();
</script>
</body>
</html>