本帖最后由 AlexZ 于 2021-3-2 15:39 编辑
区域快照顾名思义,会将表格中的某一个单元格区域,作为类似『图片』的形式在某一时刻进行『拍照』,『照片』作为形状浮动在表格上,作为原始记录的参考,效果如下图:
示例代码:- var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), {
- sheetCount: 2
- });
- var sheet = spread.getSheet(0);
- var range = sheet.shapes.addCameraShape('cameraShape', 'A1:D7', 600, 100);
复制代码
API:
- ///* function addCameraShape(name: string, range: string, left: number, top: number, width?: number, height?: number): GC.Spread.Sheets.Shapes.CameraShape
- /**
- * Add a new camera shape to shape collection
- * @param {string} name The name of the camera shape. If leave blank an unique name will be generated.
- * @param {string} range The range of the shape generated from, it should be a range formula, like Sheet1!A1:A8.
- * @param {number} left The <i>x</i> location of the camera shape.
- * @param {number} top The <i>y</i> location of the camera shape.
- * @param {number} [width] The width of the camera shape, if leave blank the default value should be same as the original range width.
- * @param {number} [height] The height of the camera shape, if leave blank the default value should be same as the original range height.
- * @return {GC.Spread.Sheets.Shapes.CameraShape} The shape that has been added to the sheet.
- * @example
- * var shape = activeSheet.shapes.addCameraShape("camera shape 1", 'Sheet1!A1:A8', 100, 50, 100, 150);
- */
- addCameraShape (name: string, range: string, left: number, top: number, width?: number, height?: number): ShapeBase
复制代码
|
|