ExcelPicture Class
Represents a picture in the worksheet.
public sealed class ExcelPicture : ExcelDrawing
Public NotInheritable Class ExcelPicture
Inherits ExcelDrawing
- Inheritance:
- System.ObjectExcelPicture
Properties
CameraRangeFormula
Gets or sets the formula used by the camera tool to fill this picture.
Property Value
- System.String
The formula used by the camera tool to fill this picture.
Remarks
The camera tool is active when this property is not null or empty. The formula will always be resolved to a cell range.
This property is not supported in XLS file format.
See Also
FlipHorizontal
Gets or sets a value indicating whether to flip the drawing horizontally - reflect it across a vertical line that intersects the center of the drawing's bounding box.
Property Value
- System.Boolean
true to flip the drawing horizontally; otherwise, false.
Remarks
This property is not supported in XLS file format.
When set to a value different than the current FlipHorizontal, MS Excel automatically inverts the Rotation to 360° - Rotation (normalized to the interval [0°, 360°>). To follow the MS Excel's behavior, you should do the same.
FlipVertical
Gets or sets a value indicating whether to flip the drawing vertically - reflect it across a horizontal line that intersects the center of the drawing's bounding box.
Property Value
- System.Boolean
true to flip the drawing horizontally; otherwise, false.
Remarks
This property is not supported in XLS file format.
When set to a value different than the current FlipVertical, MS Excel automatically inverts the Rotation to 360° - Rotation (normalized to the interval [0°, 360°>). To follow the MS Excel's behavior, you should do the same.
PictureFormat
Gets the picture format.
public ExcelPictureFormat PictureFormat { get; }
Public ReadOnly Property PictureFormat As ExcelPictureFormat
Property Value
The picture format.
PictureStream
Gets the picture stream.
public MemoryStream PictureStream { get; }
Public ReadOnly Property PictureStream As MemoryStream
Property Value
- System.IO.MemoryStream
The picture stream.
Rotation
Gets or sets the amount (in degrees) by which the drawing is rotated clockwise about the center of the drawing's bounding box.
Property Value
- System.Double
The amount (in degrees) by which the drawing is rotated clockwise about the center of the drawing's bounding box.
Remarks
This property is not supported in XLS file format.
Transparency
Gets or sets the transparency of the picture. Possible values range from 0 (full transparency) to 1 (no transparency). The default value is 1 (no transparency).
Property Value
- System.Double
The transparency of the picture.
TransparentColor
Gets or sets the transparent color in the image. By default, no transparent color is set.
public SpreadsheetColor? TransparentColor { get; set; }
Public Property TransparentColor As SpreadsheetColor?
Property Value
- System.Nullable<SpreadsheetColor>
The transparent color in the image.
Methods
BringForward()
Moves the picture one position forward in the drawings.
Remarks
The index of the picture in the ExcelPictureCollection will not be updated if the drawing in front is a different type. But it will still update the position.
BringToFront()
Brings the picture to the front of the drawings.
CalculateCameraRange()
Updates this ExcelPicture instance to reproduce the current content at the range specified in the CameraRangeFormula property.
Delete()
Removes this ExcelPicture instance from the worksheet.
MoveZIndex(Int32)
Moves the picture forward or backward in the drawings with the given relative index.
Parameters
relativeIndex
- System.Int32
The relative index for the picture to update. Negative to move backward and positive to move forward.
SendBackward()
Moves the picture one position backward in the drawings.
Remarks
The index of the picture in the ExcelPictureCollection will not be updated if the item behind is a different type. But it will still update the position.
SendToBack()
Sends the picture to the back of the drawings.
ToImage()
Converts this ExcelPicture instance to a new System.Drawing.Image instance.
Returns
- System.Drawing.Image
A new System.Drawing.Image instance created from this ExcelPicture instance.
ToString()
Returns a System.String that represents this ExcelPicture instance.
Returns
- System.String
A System.String that represents this ExcelPicture instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
Inherited Properties
Hyperlink | Gets or sets the hyperlink on this drawing (picture, chart, etc.). (Inherited from ExcelDrawing) |
Metadata | Gets the metadata (non-visual properties) of this ExcelDrawing instance. (Inherited from ExcelDrawing) |
Position | Gets the position of this drawing (picture, chart, etc.) in the worksheet. (Inherited from ExcelDrawing) |
Worksheet | Gets the parent worksheet. (Inherited from ExcelDrawing) |
ZIndex | Gets the z-order position of the picture. -1 if the picture is not contained in proper collection. (Inherited from ExcelDrawing) |
Inherited Methods
Format() | Formats this drawing (picture, chart, etc.) to its default size so it can be exported to PDF, XPS, image or be printed. (Inherited from ExcelDrawing) |
Format(System.Double, System.Double, LengthUnit) | Formats this drawing (picture, chart, etc.) to specified size so it can be exported to PDF, XPS, image or be printed. (Inherited from ExcelDrawing) |