GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ExcelShape Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a drawing that has a specific shape / geometry.

    • C#
    • VB.NET
    public sealed class ExcelShape : ExcelDrawing
    Public NotInheritable Class ExcelShape
        Inherits ExcelDrawing
    Inheritance:
    System.Object
    ExcelDrawing
    ExcelShape

    Properties

    AdjustValues

    Gets the shape's adjust values.

    • C#
    • VB.NET
    public IDictionary<string, double> AdjustValues { get; }
    Public ReadOnly Property AdjustValues As IDictionary(Of String, Double)
    Property Value
    System.Collections.Generic.IDictionary<System.String, System.Double>

    The shape's adjust values.

    Remarks

    Adjust value is a varying parameter used in calculation of shape's geometry which is specified using Drawing ML.

    Each ShapeType defines its own set of adjust values (and some/most do not have any).

    Fill

    Gets or sets the fill formatting options.

    • C#
    • VB.NET
    public FillFormat Fill { get; set; }
    Public Property Fill As FillFormat
    Property Value
    FillFormat

    The fill formatting options.

    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.

    • C#
    • VB.NET
    public bool FlipHorizontal { get; set; }
    Public Property FlipHorizontal As Boolean
    Property Value
    System.Boolean

    true to flip the drawing horizontally; otherwise, false.

    Remarks

    This property is supported only when loading and saving to XLSX and XLSB 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.

    • C#
    • VB.NET
    public bool FlipVertical { get; set; }
    Public Property FlipVertical As Boolean
    Property Value
    System.Boolean

    true to flip the drawing horizontally; otherwise, false.

    Remarks

    This property is supported only when loading and saving to XLSX and XLSB 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.

    Outline

    Gets or sets the outline formatting options.

    • C#
    • VB.NET
    public LineFormat Outline { get; set; }
    Public Property Outline As LineFormat
    Property Value
    LineFormat

    The outline formatting options.

    Rotation

    Gets or sets the amount (in degrees) by which the drawing is rotated clockwise about the center of the drawing's bounding box.

    • C#
    • VB.NET
    public double Rotation { get; set; }
    Public Property Rotation As Double
    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 supported only when loading and saving to XLSX and XLSB file format.

    ShapeType

    Gets or sets the type of the shape (geometry).

    • C#
    • VB.NET
    public ShapeType ShapeType { get; }
    Public ReadOnly Property ShapeType As ShapeType
    Property Value
    ShapeType

    The type of the shape (geometry).

    Text

    Gets the text content and formatting associated with this ExcelShape.

    • C#
    • VB.NET
    public TextBox Text { get; }
    Public ReadOnly Property Text As TextBox
    Property Value
    TextBox

    The text content and formatting associated with this ExcelShape.

    Methods

    BringForward()

    Moves the shape one position forward in the drawings.

    • C#
    • VB.NET
    public void BringForward()
    Public Sub BringForward
    Remarks

    The index of the shape in the collection will not be updated if the drawing in front is a different type. But it will still update the position.

    BringToFront()

    Brings the shape to the front of the drawings.

    • C#
    • VB.NET
    public void BringToFront()
    Public Sub BringToFront

    MoveZIndex(Int32)

    Moves the shape forward or backward in the drawings with the given relative index.

    • C#
    • VB.NET
    public void MoveZIndex(int relativeIndex)
    Public Sub MoveZIndex(relativeIndex As Integer)
    Parameters
    relativeIndex
    System.Int32

    The relative index for the shape to update. Negative to move backward and positive to move forward.

    SendBackward()

    Moves the shape one position backward in the drawings.

    • C#
    • VB.NET
    public void SendBackward()
    Public Sub SendBackward
    Remarks

    The index of the shape in the collection will not be updated if the item behind is a different type. But it will still update the position.

    SendToBack()

    Sends the shape to the back of the drawings.

    • C#
    • VB.NET
    public void SendToBack()
    Public Sub SendToBack

    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)

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.