直接拿不到可能是缓存的问题,先临时绕一下
- function getSrc(sheet, text) {
- sheet.shapes.remove("rectangle")
- var shape = sheet.shapes.add("rectangle", GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, 0, 0, 500, 500);
- // switch to picture fill
- var style = shape.style();
- style.fill = { src: '' };
- shape.style(style);
-
- // bind sparkline formula to picture fill source.
- shape.setFormula('style.fill.src', '=BC_QRCODE("' + text + '","#000","#FFF","L",2,"auto","auto",FALSE,0,,"UTF-8",,,,)')
- return shape.toImageSrc()
- }
复制代码- getSrc(sheet, "12345999")
- setTimeout(function () {
- console.log( getSrc(sheet, "12345999"))
- }, 10)
复制代码 |