canvas转blob:
canvas.toBlob(function(blob){...}, "image/jpeg", 0.95); // 默认不传参数为image/png类型,分辨率为96dpi
canvas转base64:
canvas.toDataURL(type, encoderOptions); // 默认格式为image/png,默认值 0.92
canvas.toBlob(function(blob){...}, "image/jpeg", 0.95); // 默认不传参数为image/png类型,分辨率为96dpi
canvas.toDataURL(type, encoderOptions); // 默认格式为image/png,默认值 0.92
本文标题:各种文件流总结
本文链接:https://www.haomeiwen.com/subject/mofnjqtx.html
网友评论