Skip to content

Commit

Permalink
add chapter11
Browse files Browse the repository at this point in the history
  • Loading branch information
airingursb committed Jul 30, 2015
1 parent d1f03e8 commit f04ff70
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Canvas/11/11-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>二次贝塞尔曲线</title>
<style>
body { background: url("./images/bg3.jpg") repeat; }
#canvas { border: 1px solid #aaaaaa; display: block; margin: 50px auto; }
</style>
</head>
<body>
<div id="canvas-warp">
<canvas id="canvas">
你的浏览器居然不支持Canvas?!赶快换一个吧!!
</canvas>
</div>

<script>
window.onload = function(){
var canvas = document.getElementById("canvas");
canvas.width = 800;
canvas.height = 600;
var context = canvas.getContext("2d");
context.fillStyle = "#FFF";
context.fillRect(0,0,800,600);

context.lineWidth = 6;
context.strokeStyle = "#333";
context.beginPath();
context.moveTo(60, 337);
context.quadraticCurveTo(256, 43, 458, 336);
context.stroke();
};

</script>
</body>
</html>
Binary file added Canvas/11/images/bg1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Canvas/11/images/bg2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Canvas/11/images/bg3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f04ff70

Please sign in to comment.