要混合,您需要按 50-50 的比例混合两张图像。让我们看看如何:混合图像 window.onload = function () { var myImg1 = document.getElementById('myImg1'); var myImg2 = document.getElementById('myImg2'); var myCanvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); // 宽度和高度 var w = img1.width; var h = img1.height; myCanvas.width = w; myCanvas.height = h; var pixels = 4 ... 阅读更多