我修改了临时: _html2canvas.Util.isTransparent 来自
_html2canvas.Util.isTransparent = function(backgroundColor) {
return (backgroundColor === "transparent" || backgroundColor === "rgba(0, 0, 0, 0)");
};
到
_html2canvas.Util.isTransparent = function(backgroundColor) {
return (backgroundColor === "transparent" || backgroundColor === "rgba(0, 0, 0, 0)" || backgroundColor === undefined);
};
之后调用带有背景参数集的 html2canvas 就足够了:
html2canvas(screenshot_element, {
background :'#FFFFFF',
onrendered: function (canvas) {
.....
}
});
对我来说......将透明视为未定义的背景是有意义的。