npm install edgeit.js
# 或
yarn add edgeit.js
const processor = new EdgeIt({
strokeColor: '#ff3b30', // 描边颜色
strokeWidth: 4 // 描边宽度(像素)
});
// 处理网络图片
processor.process('https://example.com/image.jpg')
.then(result => document.body.appendChild(result));
参数 | 类型 | 默认值 | 说明 |
---|---|---|---|
| String |
| 描边颜色(支持 CSS 颜色格式) |
| Number |
| 描边宽度(像素) |
| Boolean |
| 缓存图片对象,下次不用重新加载 |
| Boolean |
| 启用抗锯齿 |
| Boolean |
| 启用imageSmoothing |
| Number |
| 指定输出图像的宽度 (可选) |
| Number |
| 指定输出图像的高度(可选) |
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。