纯前端实现图片添加水印:
图片上传预览压缩的思路在Multi-picture-compression-and-Preview项目中有详解
添加水印的实现思路:在第一次执行drawImage()后,再增加图层绘制水印图片或文字
globalAlpha设置水印的不透明度,默认设置是0.6
demo中增加是否支持html5拾色器的判断,自动匹配拾色器和颜色选择器
上传图片添加水印后支持直接下载 点击示例
mn3711698 / watermark-canvas Goto Github PK
View Code? Open in Web Editor NEWThis project forked from dantyli/watermark-canvas
通过canvas画布实现图片添加水印