ExcelDrawing Class
Represents a base class for all drawings (pictures, charts, etc.) in the worksheet.
- Inheritance:
- System.ObjectExcelDrawing
- Derived
Properties
Hyperlink
Gets or sets the hyperlink on this drawing (picture, chart, etc.).
public SpreadsheetHyperlink Hyperlink { get; set; }
Public Property Hyperlink As SpreadsheetHyperlink
Property Value
The hyperlink on this drawing (picture, chart, etc.).
Remarks
Supported only in XLSX and XLSB.
Metadata
Gets the metadata (non-visual properties) of this ExcelDrawing instance.
public ExcelDrawingMetadata Metadata { get; }
Public ReadOnly Property Metadata As ExcelDrawingMetadata
Property Value
The metadata (non-visual properties) of this ExcelDrawing instance.
Position
Gets the position of this drawing (picture, chart, etc.) in the worksheet.
public ExcelDrawingPosition Position { get; }
Public ReadOnly Property Position As ExcelDrawingPosition
Property Value
The position of this drawing (picture, chart, etc.) in the worksheet.
Worksheet
Gets the parent worksheet.
public ExcelWorksheet Worksheet { get; }
Public ReadOnly Property Worksheet As ExcelWorksheet
Property Value
The parent worksheet.
ZIndex
Gets the z-order position of the picture. -1 if the picture is not contained in proper collection.
Property Value
- System.Int32
The z-order position of the picture.
Methods
Format()
Formats this drawing (picture, chart, etc.) to its default size so it can be exported to PDF, XPS, image or be printed.
Returns
Formatted drawing (picture, chart, etc.) which can be exported to PDF, XPS, image or be printed.
Exceptions
Drawing cannot be formatted because it doesn't belong to any worksheet.
Format(Double, Double, LengthUnit)
Formats this drawing (picture, chart, etc.) to specified size so it can be exported to PDF, XPS, image or be printed.
public FormattedExcelDrawing Format(double width, double height, LengthUnit unit)
Public Function Format(width As Double, height As Double, unit As LengthUnit) As FormattedExcelDrawing
Parameters
width
- System.Double
The formatted drawing width.
height
- System.Double
The formatted drawing height.
unit
- LengthUnit
The formatted drawing width / height length unit.
Returns
Formatted drawing (picture, chart, etc.) which can be exported to PDF, XPS, image or be printed.
Exceptions
Drawing cannot be formatted because it doesn't belong to any worksheet.