| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2023-12-18 11:02:55 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-12-18 11:23:55 |
| | | * @LastEditTime: 2023-12-18 17:55:12 |
| | | * @FilePath: \jczz_web\src\warterMarkVUE.js |
| | | * @Description: |
| | | * |
| | |
| | | //创建画布 |
| | | let createCanvas = document.createElement("canvas"); |
| | | // 设置canvas画布大小 |
| | | createCanvas.width = 200; //宽度 |
| | | createCanvas.height = 160; //高度 |
| | | createCanvas.width = 320; //宽度 |
| | | createCanvas.height = 200; //高度 |
| | | |
| | | //创建Context2D对象作为2D渲染的上下文。 |
| | | let Context2D = createCanvas.getContext("2d"); |
| | |
| | | Context2D.fillStyle = "#fff"; //水印颜色 HEX格式,可使用red 或者rgb格式 |
| | | Context2D.textAlign = "center"; //水印水平位置 |
| | | Context2D.textBaseline = "Middle"; //水印垂直位置 |
| | | Context2D.fillText(str, createCanvas.width / 2.8, createCanvas.height / 1); |
| | | Context2D.fillText(str, createCanvas.width / 3.2, createCanvas.height / 1); |
| | | |
| | | //创建元素 |
| | | let createDiv = document.createElement("div"); |