Closed duanxb closed 3 years ago
//frames 为最新的gif 帧数组 const tasks=[]; const newData = []; frames.forEach((item,index)=>{ tasks.push({ index, data:item.data last: index === frames.length - 1, delay: item.delay*10, width:item.w, height:item.h, quality:10, debug: false, dither: true, transparent:true, globalPalette:false, repeat:0, background:"#000000", canTransfer:true }) gworker.postMessage(tasks[index]); }); 图片数据可以通过getImageData拿到,delay 怎么拿到呢?
//frames 为最新的gif 帧数组 const tasks=[]; const newData = []; frames.forEach((item,index)=>{ tasks.push({ index, data:item.data last: index === frames.length - 1, delay: item.delay*10, width:item.w, height:item.h, quality:10, debug: false, dither: true, transparent:true, globalPalette:false, repeat:0, background:"#000000", canTransfer:true }) gworker.postMessage(tasks[index]); }); 图片数据可以通过getImageData拿到,delay 怎么拿到呢?