/
excelscript.image.yml
76 lines (71 loc) · 2.19 KB
/
excelscript.image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
### YamlMime:TSType
name: ExcelScript.Image
uid: 'ExcelScript!ExcelScript.Image:interface'
package: ExcelScript!
fullName: ExcelScript.Image
summary: 'Represents an image in the worksheet. To get the corresponding `Shape` object, use `Image.getShape`<!-- -->.'
remarks: |-
#### Examples
```TypeScript
/**
* This script transfers an image from one worksheet to another.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the worksheet with the image on it.
const firstWorksheet = workbook.getWorksheet("FirstSheet");
// Get the first image from the worksheet.
// If a script added the image, you could add a name to make it easier to find.
let image: ExcelScript.Image;
firstWorksheet.getShapes().forEach((shape, index) => {
if (shape.getType() === ExcelScript.ShapeType.image) {
image = shape.getImage();
return;
}
});
// Copy the image to another worksheet.
image.getShape().copyTo("SecondSheet");
}
```
isPreview: false
isDeprecated: false
type: interface
methods:
- name: getFormat()
uid: 'ExcelScript!ExcelScript.Image#getFormat:member(1)'
package: ExcelScript!
fullName: getFormat()
summary: Returns the format of the image.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getFormat(): PictureFormat;'
return:
type: '<xref uid="ExcelScript!ExcelScript.PictureFormat:enum" />'
description: ''
- name: getId()
uid: 'ExcelScript!ExcelScript.Image#getId:member(1)'
package: ExcelScript!
fullName: getId()
summary: Specifies the shape identifier for the image object.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getId(): string;'
return:
type: string
description: ''
- name: getShape()
uid: 'ExcelScript!ExcelScript.Image#getShape:member(1)'
package: ExcelScript!
fullName: getShape()
summary: Returns the `Shape` object associated with the image.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getShape(): Shape;'
return:
type: '<xref uid="ExcelScript!ExcelScript.Shape:interface" />'
description: ''