png transparent

This commit is contained in:
CPunisher 2020-09-01 15:30:40 +08:00
parent 38d2e779b6
commit a6d5239855
1 changed files with 2 additions and 2 deletions

View File

@ -44,8 +44,8 @@ export function saveImg(value, content, width, height, type) {
return new Promise(resolve => { return new Promise(resolve => {
img.onload = () => { img.onload = () => {
ctx.fillStyle = 'white' ctx.fillStyle = 'white';
ctx.fillRect(0, 0, width, height) if (type === 'jpg') ctx.fillRect(0, 0, width, height);
ctx.drawImage(img, 0, 0, width, height); ctx.drawImage(img, 0, 0, width, height);
// `download` attr is not well supported // `download` attr is not well supported
// Will result in a download popup for chrome and the // Will result in a download popup for chrome and the