Comment: HTML5 can draw gradient background pictures and download them automatically. The following is a detailed step for everyone. Friends who like it should not miss it.
drawBgLine.html<!DOCTYPE html>
<head>
<meta charset="UTF-8"/>
<title>html5 draws gradient background picture and automatically downloads</title>
</head>
<body>
<center>
<canvas >/canvas>
</center>
<script>
//Step 1: Get the canvas object
var c = document.getElementById("c");
//Step 2: Get the context object of the canvas object
var context = c.getContext("2d");
/*
* These are drawing other graphic codes
context.beginPath();
context.lineWidth=10;
context.strokeStyle="red";
context.moveTo(50,50);
context.lineTo(150,50);
context.stroke();
context.closePath();
//context.strokeRect(220,50,50,50);
context.fillStyle="blue";
context.fillRect(220,50,50,50);
context.beginPath();
context.arc(150,150,50,0*Math.PI/180,-180*Math.PI/180, false);
context.lineTo(150,150);
context.closePath();
context.stroke();
context.lineWidth=1;
context.font="50px Songyi";
context.fillText("brip",0,220);
context.save();
context.translate(50,50);
context.rotate(90*Math.PI/180);
context.beginPath();
context.lineWidth=10;
context.strokeStyle="red";
context.moveTo(0,0);
context.lineTo(100,0);
context.stroke();
context.closePath();
context.restore();
*/
var g = context.createLinearGradient(0,0,0,200);
g.addColorStop(0,"90BFFF");
g.addColorStop(1,"white");
context.fillStyle = g;
context.fillRect(0,0,1,200);
window.location = c.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");
</script>
</body>