Class ExcelDrawing¶
Namespace: OfficeOpenXml.Drawing
Assembly: EPPlus.dll
Base class for drawings. Drawings are Charts, Shapes and Pictures.
Inheritance¶
object ← XmlHelper ← ExcelDrawing
Derived¶
ExcelChart
ExcelControl
ExcelGroupShape
ExcelPicture
ExcelShapeBase
ExcelSlicer<T>
Implements¶
Inherited Members¶
object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()
Fields¶
EMU_PER_CM¶
The ratio between EMU and centimeters
Field Value¶
EMU_PER_MM¶
The ratio between EMU and milimeters
Field Value¶
EMU_PER_PICA¶
The ratio between EMU and pica
Field Value¶
EMU_PER_PIXEL¶
The ratio between EMU and Pixels
Field Value¶
EMU_PER_POINT¶
The ratio between EMU and Points
Field Value¶
EMU_PER_US_INCH¶
The ratio between EMU and US Inches
Field Value¶
Properties¶
As¶
Provides access to type conversion for all top-level drawing classes.
Property Value¶
CellAnchor¶
How the drawing is anchored to the cells. This effect how the drawing will be resize ChangeCellAnchor(eEditAs, int, int, int, int)
Property Value¶
Description¶
A description of the drawing object
Property Value¶
DrawingType¶
The type of drawing
Property Value¶
EditAs¶
How Excel resize drawings when the column width is changed within Excel.
Property Value¶
From¶
Top Left position, if the shape is of the one- or two- cell anchor type Otherwise this propery is set to null
Property Value¶
Hyperlink¶
Hyperlink
Property Value¶
Uri
Locked¶
Lock drawing
Property Value¶
Name¶
The name of the drawing object
Property Value¶
ParentGroup¶
If the drawing is grouped this property contains the Group drawing containing the group. Otherwise this property is null
Property Value¶
Position¶
Top Left position, if the shape is of the absolute anchor type
Property Value¶
Print¶
Print drawing with sheet
Property Value¶
Size¶
The extent of the shape, if the shape is of the one- or absolute- anchor type. Otherwise this propery is set to null
Property Value¶
To¶
Bottom right position
Property Value¶
Methods¶
AdjustPositionAndSize()¶
Will adjust the position and size of the drawing according to changes in font of rows and to the Normal style. This method will be called before save, so use it only if you need the coordinates of the drawing.
BringToFront()¶
Brings the drawing to the front of any overlapping drawings.
ChangeCellAnchor(eEditAs, int, int, int, int)¶
This will change the cell anchor type, move and resize the drawing.
Parameters¶
type eEditAs
The cell anchor type to change to
PixelTop int
The topmost pixel
PixelLeft int
The leftmost pixel
width int
The width in pixels
height int
The height in pixels
ChangeCellAnchor(eEditAs)¶
This will change the cell anchor type without modifiying the position and size.
Parameters¶
type eEditAs
The cell anchor type to change to
Dispose()¶
Dispose the object
Group(params ExcelDrawing[])¶
Group the drawing together with a list of other drawings. UnGroup(bool) ParentGroup
Parameters¶
drawing ExcelDrawing[]
The drawings to group
Returns¶
The group shape
SendToBack()¶
Sends the drawing to the back of any overlapping drawings.
SetPosition(int, int)¶
Set the top left corner of a drawing. Note that resizing columns / rows after using this function will effect the position of the drawing
Parameters¶
PixelTop int
Top pixel
PixelLeft int
Left pixel
SetPosition(int, int, int, int)¶
Set the top left corner of a drawing. Note that resizing columns / rows after using this function will effect the position of the drawing
Parameters¶
Row int
Start row - 0-based index.
RowOffsetPixels int
Offset in pixels
Column int
Start Column - 0-based index.
ColumnOffsetPixels int
Offset in pixels
SetSize(int)¶
Set size in Percent. Note that resizing columns / rows after using this function will effect the size of the drawing
Parameters¶
Percent int
SetSize(int, int)¶
Set size in pixels Note that resizing columns / rows after using this function will effect the size of the drawing
Parameters¶
PixelWidth int
Width in pixels
PixelHeight int
Height in pixels
UnGroup(bool)¶
Will ungroup this drawing or the entire group, if this drawing is grouped together with other drawings. If this drawings is not grouped an InvalidOperationException will be returned.
Parameters¶
ungroupThisItemOnly bool
If true this drawing will be removed from the group. If it is false, the whole group will be disbanded. If true only this drawing will be removed.