-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.html
32 lines (32 loc) · 890 Bytes
/
test.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
Document
</title>
<script src="Canvas2Image.js">
</script>
<script src="Watermark.js">
</script>
</meta>
</head>
<body>
<canvas id="id" />
</body>
<script>
console.log(Canvas2Image)
var isExist= true,
text= "仅用于办理住房公积金,他用无效。",
hex= "#000000",
rgb= { r: 0, g: 0, b: 0, a: 0.4 },
fontSize= 23,
watermarkHeight= 180,
watermarkWidth= 280,
fillStyle = `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${rgb.a})`;
var watermark = new Watermark(document.getElementById('id'));
console.log(watermark)
watermark.setOptions({ text, fillStyle, fontSize, watermarkWidth, watermarkHeight });
watermark.draw('example.jpg');
</script>
</html>