Commit 2aeb6bb2 authored by wang's avatar wang

从数据库读取环境

parent aec93674
......@@ -3942,15 +3942,15 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
// // ctx.clearRect(0, 0, 200, 200); // 擦除(0,0)位置大小为200x200的矩形,擦除的意思是把该区域变为透明
// ctx.fillStyle = '#dddddd'; // 设置颜色
// ctx.fillRect(parseInt(Math.random() * 20 + 20), parseInt(Math.random() * 20 + 20), parseInt(Math.random() * 20 + 20), parseInt(Math.random() * 20 + 20)); // 把(10,10)位置大小为130x130的矩形涂色
if (this.width > 100 && this.height > 100) {
for (let i = 0; i < randInt(10, 20); i++) {
let ctx = canvas.getContext('2d');
let color = Math.floor(Math.random() * 150);
ctx.fillStyle = "rgba(" + color + "," + color + "," + color + ",1)";
ctx.fillRect(randInt(0, this.width), randInt(0, this.height), 1, 1)
}
}
// if (this.width > 100 && this.height > 100) {
// for (let i = 0; i < randInt(10, 20); i++) {
// let ctx = canvas.getContext('2d');
//
// let color = Math.floor(Math.random() * 150);
// ctx.fillStyle = "rgba(" + color + "," + color + "," + color + ",1)";
// ctx.fillRect(randInt(0, this.width), randInt(0, this.height), 1, 1)
// }
// }
let res = canvas.toDataURL(...args);
if (this.width === 300 && this.height === 150) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment