[]
Creates a camera picture from a reference range and places it at the specified position.
Returns the IShape object that represents the new picture.
The left and top parameters specify the placement position in points.
IShape AddCameraPicture(string reference, double left, double top)
Function AddCameraPicture(reference As String, left As Double, top As Double) As IShape
| Type | Name | Description |
|---|---|---|
| string | reference | The reference of the range used to generate the picture. |
| double | left | The position, in points, of the upper-left corner of the picture relative to the upper-left corner of the document. |
| double | top | The position, in points, of the upper-left corner of the picture relative to the top of the document. |
| Type | Description |
|---|---|
| IShape | The IShape object that represents the new picture. |
worksheet.Range["A1:B2"].Value = new object[,] {
{"Name", "Value"},
{"Test", 100}
};
IShape picture = worksheet.Shapes.AddCameraPicture("=$A$1:$B$2", 20, 20);
picture.Name = "SalesSnapshot";
Creates a camera picture from a reference range.
Returns the IShape object that represents the new picture. The picture is placed at the specified position and sized using point units.
IShape AddCameraPicture(string reference, double left, double top, double width, double height)
Function AddCameraPicture(reference As String, left As Double, top As Double, width As Double, height As Double) As IShape
| Type | Name | Description |
|---|---|---|
| string | reference | The range reference string that identifies the source range from which the picture is generated. |
| double | left | The position (in points) of the upper-left corner of the picture relative to the upper-left corner of the document. |
| double | top | The position (in points) of the upper-left corner of the picture relative to the top of the document. |
| double | width | The width of the camera picture's boundary box, in points. |
| double | height | The height of the camera picture's boundary box, in points. |
| Type | Description |
|---|---|
| IShape | The IShape object that represents the new picture. |
worksheet.Range["A1:B2"].Value = new object[,] {
{"Name", "Value"},
{"Test", 100}
};
IShape picture = worksheet.Shapes.AddCameraPicture("=$A$1:$B$2", 20, 30, 160, 80);
Creates a camera picture from a reference range and places it in the specified target range on the current sheet.
The worksheet that contains targetRange must be the same worksheet that owns this
IShapes collection. The returned picture is positioned and sized to match the
specified target range.
IShape AddCameraPicture(string reference, IRange targetRange)
Function AddCameraPicture(reference As String, targetRange As IRange) As IShape
| Type | Name | Description |
|---|---|---|
| string | reference | The reference of the source range used to generate the picture. |
| IRange | targetRange | The target range on the current sheet where the picture is placed. |
| Type | Description |
|---|---|
| IShape | The IShape object that represents the new picture. |
worksheet.Range["A10:C20"].Value = new object[,] {
{"Name", "Value", "Status"},
{"Item A", 100, "Open"}
};
IRange targetRange = worksheet.Range["E2:G6"];
IShape picture = worksheet.Shapes.AddCameraPicture("A10:C20", targetRange);
Creates a camera picture from a reference range and places it at the specified position.
The returned picture is generated from the source range and remains linked to that range.
Use name to assign a name to the created picture.
IShape AddCameraPicture(string reference, string name, double left, double top)
Function AddCameraPicture(reference As String, name As String, left As Double, top As Double) As IShape
| Type | Name | Description |
|---|---|---|
| string | reference | The reference of the source range used to generate the picture. |
| string | name | The name of the picture. |
| double | left | The position, in points, of the upper-left corner of the picture relative to the upper-left corner of the document. |
| double | top | The position, in points, of the upper-left corner of the picture relative to the top of the document. |
| Type | Description |
|---|---|
| IShape | The IShape object that represents the new picture. |
worksheet.Range["A1:B2"].Value = new object[,] {
{"Name", "Value"},
{"Test", 100}
};
IShape picture = worksheet.Shapes.AddCameraPicture("=$A$1:$B$2", "SalesSnapshot", 20, 20);
picture.PictureFormat.TransparentBackground = true;
Creates a camera picture from a reference range and places it at the specified position and size.
The returned picture is generated from the source range and remains linked to that range.
Use name to assign a name to the created picture.
IShape AddCameraPicture(string reference, string name, double left, double top, double width, double height)
Function AddCameraPicture(reference As String, name As String, left As Double, top As Double, width As Double, height As Double) As IShape
| Type | Name | Description |
|---|---|---|
| string | reference | The reference of the source range used to generate the picture. |
| string | name | The name of the picture. |
| double | left | The position, in points, of the upper-left corner of the picture relative to the upper-left corner of the document. |
| double | top | The position, in points, of the upper-left corner of the picture relative to the top of the document. |
| double | width | The width of the picture's boundary box, in points. |
| double | height | The height of the picture's boundary box, in points. |
| Type | Description |
|---|---|
| IShape | The IShape object that represents the new picture. |
worksheet.Range["A1:B2"].Value = new object[,] {
{"Name", "Value"},
{"Test", 100}
};
IShape picture = worksheet.Shapes.AddCameraPicture("=$A$1:$B$2", "SalesSnapshot", 20, 20, 120, 60);
picture.PictureFormat.TransparentBackground = true;
Creates a camera picture from a referenced source range and places it in the specified target range on the current sheet.
A camera picture is a dynamic linked picture of the referenced range. The sheet of the target targetRange
and the sheet to which the shape is added must be the same sheet.
IShape AddCameraPicture(string reference, string name, IRange targetRange)
Function AddCameraPicture(reference As String, name As String, targetRange As IRange) As IShape
| Type | Name | Description |
|---|---|---|
| string | reference | The source range reference for the camera picture, such as an A1-style range reference. |
| string | name | The name of the picture. |
| IRange | targetRange | The target range on the current sheet where the camera picture is placed. |
| Type | Description |
|---|---|
| IShape | The IShape object that represents the new picture. |
worksheet.Range["A1:B2"].Value = new object[,] {
{"Name", "Value"},
{"Test", 100}
};
IShape shape = worksheet.Shapes.AddCameraPicture("=$A$1:$B$2", "CameraPicture1", worksheet.Range["D1:E2"]);