cleverliurx / l-watermark Goto Github PK
View Code? Open in Web Editor NEWA web watermark SDK, support: custom watermark content and style, watermark encryption and decryption, watermark anomaly monitoring, etc.
License: MIT License
A web watermark SDK, support: custom watermark content and style, watermark encryption and decryption, watermark anomaly monitoring, etc.
License: MIT License
WaterMark.image({
target: document.getElementById("demo-image"),
text: "User Id: 1008611",
position: 'center',
secret: true,
})
然后对生成的图片截图,拿截图去解密,就解密不出来~
// 图片水印显示
const decodeImage = async () => {
const demoImg = document.getElementById("demo-image2"); // 图片截图
const decodeSrc = await WaterMark.utils.decodeImage(demoImg.src)
document.getElementById("imgDom").src = decodeSrc
}
decodeImage()
使用中发现当手动改变水印元素的属性时会重新添加一个新的水印,原来的水印并没有移除掉,页面上就同时出现了多个水印叠加
Lines 53 to 55 in 1f351cc
这里新添加元素之后 GuardDom.target 也没有和 PageWaterMark.watermakr 同步,导致 PageWaterMark.remove 只能移除掉最开始的那个水印元素
看起来是 canvas 绘图共有的问题,能否优化一下呢 @CleverLiurx
const watermark = WaterMark.page({
containerEl: document.body,
text: '预览模式',
color: `${theme.semanticColors.bodyText}44`,
fontSize: 16,
vSpace: 35,
cSpace: 35,
});
cSpace和vSpace失效
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.