Skip to content

基于canvas做的水印插件,功能比较简单,可添加一个水印图片和多个水印文字。

License

Notifications You must be signed in to change notification settings

iamcaochong/watermark.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

watermark.js

license

Usage

<div id="demo_div" style="width: 1300px; height: 1400px;"></div>
...
<script src="watermark.js" charset="utf-8"></script>

This code creates a watermark preview, with text image and Lattice points.

watermarks.init({id:'demo_div',lean:true,fontSize:20,fontFamily:'Georgia',fontColor:'black'})
		.addText({text:'center content',type:1})
		.addText({text:'upper left content',type:2})
		.addText({text:'bottom left content',type:4})
		.addText({text:'upper right content',type:8})
		.addText({text:'bottom right content',type:16})
		.addImage({viewType: 2,imgAlpha: 50,layer:1, src:"https://avatars1.githubusercontent.com/ml/89?s=106&v=4"})
		.addPoints({l:40,d:3,p:0,color:'#b5b5b5',transparent:50, content:'01234568'})
		.draw();

Demo

This is an example link.

About

基于canvas做的水印插件,功能比较简单,可添加一个水印图片和多个水印文字。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published