水印图片 JavaScript 生成库 alimask

码农软件 · 软件分类 · 图形/图像处理 · 2019-09-05 16:43:26

软件介绍

alimask

alimask 是一个使用 canvas 生成类似阿里巴巴内部网站水印图片的 JavaScript 库。Online demo here.

1. Install

npm install alimask

Then import it.

<script type="text/javascript" src="dist/alimask.min.js"></script>
// or
var alimask = require('alimask');
// or
import alimask from 'alimask';

Then use alimask(text, options) API.

alimask('王小为(小为) 888888');

alimask('王小为(小为) 888888', { color: '#f6dcd7' });

alimask('小泥巴(小美) 888888', { alpha: 0.5 });

2. API

The unique API is: alimask(text, options).

  • text (String): required, the text in the watermark image.

  • options (Object): optional, the options of watermark, with keys below:

    • width (Number): default is 250.

    • height (Number): default is 80.

    • color (String): the text color, default is #ebebeb.

    • alpha (Float): the text alpha(0 ~ 1), default is 0.8.

    • font (String): the text font style, default is 10px Arial.

The api return the base64 string of watermark image which can be used in css background / img tag.

3. Build & Test

npm install

npm run build

npm test

本文地址:https://codercto.com/soft/d/13943.html

区块链

区块链

(美)梅兰妮·斯万 / 新星出版社 / 2016-1-1 / 50元

本书以全景式的方式介绍了区块链相关技术目前发展状况和未来技术衍生方向的展望,作者认为区块链技术可能是继互联网发明以来最大的技术革命。全书从比特币的概念模型和区块链技术正开始结合的方面讨论了三个不同的结构层面:区块链1.0、2.0和3.0。首先介绍了比特币和区块链技术的基本定义和概念,还有作为区块链1.0应用核心的货币和支付系统。其次,区块链2.0将超越货币范畴,会发展为货币市场和金融应用,类似于合......一起来看看 《区块链》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具