<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> canvas 手写毛笔字效果 </title>
<style type="text/css">
#canvasId {
background-color: #FFFFcc;
}
</style>
</head>
<body>
<canvas id="canvasId" width="700" height="500"></canvas><br />
<input type="button" value="clear" onclick="hw.clear();" />
<script type="text/javascript">
function Handwriting(id) {
this.canvas = document.getElementById(id);
this.ctx = this.canvas.getContext("2d");
this.ctx.fillStyle = "rgba(0,0,0,0.25)";
var _this = this;
this.canvas.onmousedown = function (e) { _this.downEvent(e)};
this.canvas.onmousemo
canvas 手写毛笔字效果
最新推荐文章于 2024-10-23 16:57:31 发布