2021
04-07
04-07
js使用Canvas将多张图片合并成一张的实现代码
解决方案functionmergeImgs(list){constimgDom=document.createElement('img')document.body.appendChild(imgDom)constcanvas=document.createElement('canvas')canvas.width=500canvas.height=500*list.lengthconstcontext=canvas.getContext('2d')list.map((item,index)=>{constimg=newImage()img.src=item//跨域img.crossOrigin='Anonymous'img.onload=()=>{context.drawImage...
继续阅读 >