本帖最后由 不吐葡萄皮 于 2024-10-9 18:30 编辑
知道了你的要求,那就是等一会儿就能拿到绘制出来的图片了,比如下面代码:
- var camera = sheet.shapes.addCameraShape("CameraShape1", "Sheet1!D5", 30, 45, 340, 330);
- sheet.setFormula(4,3,"=BC_QRCODE(A1)")
- async function example() {
- const data = [110,120,119];
- for (var index = 0; index<data.length; index++) {
- var item = data[index];
- await new Promise(resolve => {
- sheet.setValue(0,0,item);
- setTimeout(()=>{
- var src = camera.toImageSrc();
- sheet.shapes.addPictureShape(""+item, src, camera.x()+index*80, camera.y(), camera.width(), camera.height());
- resolve();
- }, 500);
- });
- }
- }
- example();
复制代码 |