## Shape class

Represents the msodrawing object.

```csharp
public class Shape
```

## Properties

| Name | Description |
| --- | --- |
| [ActiveXControl](../../aspose.cells.drawing/shape/activexcontrol/) { get; } | Gets the ActiveX control. |
| [ActualLowerRightRow](../../aspose.cells.drawing/shape/actuallowerrightrow/) { get; } | Get the actual bottom row. |
| [AlternativeText](../../aspose.cells.drawing/shape/alternativetext/) { get; set; } | Returns or sets the descriptive (alternative) text string of the `Shape` object. |
| [AnchorType](../../aspose.cells.drawing/shape/anchortype/) { get; set; } | Gets and set the type of the shape anchor placeholder. |
| [AutoShapeType](../../aspose.cells.drawing/shape/autoshapetype/) { get; set; } | Gets and sets the auto shape type. |
| [Bottom](../../aspose.cells.drawing/shape/bottom/) { get; set; } | Represents the width of the shape's vertical offset from its lower bottom corner row, in unit of pixels. |
| [ControlData](../../aspose.cells.drawing/shape/controldata/) { get; } | Gets the data of control. |
| [CreateId](../../aspose.cells.drawing/shape/createid/) { get; set; } | Gets and sets create id for this shape. |
| [Fill](../../aspose.cells.drawing/shape/fill/) { get; } | Returns a [`FillFormat`](./fillformat/) object that contains fill formatting properties for the specified shape. |
| [FillFormat](../../aspose.cells.drawing/shape/fillformat/) { get; } | (**Obsolete.**) Returns a MsoFillFormat object that contains fill formatting properties for the specified shape. |
| [Font](../../aspose.cells.drawing/shape/font/) { get; set; } | Represents the font of shape. |
| [FormatPicture](../../aspose.cells.drawing/shape/formatpicture/) { get; } | Gets and sets the options of the picture format. |
| [Geometry](../../aspose.cells.drawing/shape/geometry/) { get; } | Gets the geometry |
| [Glow](../../aspose.cells.drawing/shape/glow/) { get; } | Represents a [`GlowEffect`](../gloweffect/) object that specifies glow effect for the chart element or shape. |
| [Group](../../aspose.cells.drawing/shape/group/) { get; } | Gets the group shape which contains this shape. |
| [HasLine](../../aspose.cells.drawing/shape/hasline/) { get; set; } | Gets and sets the line border of the shape is visible. |
| [Height](../../aspose.cells.drawing/shape/height/) { get; set; } | Represents the height of shape, in unit of pixel. |
| [HeightCM](../../aspose.cells.drawing/shape/heightcm/) { get; set; } | Represents the height of the shape, in unit of centimeters. |
| [HeightInch](../../aspose.cells.drawing/shape/heightinch/) { get; set; } | Represents the height of the shape, in unit of inches. |
| [HeightInShape](../../aspose.cells.drawing/shape/heightinshape/) { get; set; } | Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape.. |
| [HeightPt](../../aspose.cells.drawing/shape/heightpt/) { get; set; } | Represents the height of the shape, in unit of points. |
| [HeightScale](../../aspose.cells.drawing/shape/heightscale/) { get; set; } | Gets and sets the height scale,in unit of percent of the original picture height. If the shape is not picture ,the HeightScale property only returns 100; |
| [HtmlText](../../aspose.cells.drawing/shape/htmltext/) { get; set; } | Gets and sets the html string which contains data and some formats in this textbox. |
| [Hyperlink](../../aspose.cells.drawing/shape/hyperlink/) { get; } | Gets the hyperlink of the shape. |
| [Id](../../aspose.cells.drawing/shape/id/) { get; } | Gets the identifier of this shape. |
| [InputRange](../../aspose.cells.drawing/shape/inputrange/) { get; set; } | Gets or sets the worksheet range used to fill the specified combo box. |
| [IsAspectRatioLocked](../../aspose.cells.drawing/shape/isaspectratiolocked/) { get; set; } | True means that aspect ratio of the shape is locked. |
| [IsDecorative](../../aspose.cells.drawing/shape/isdecorative/) { get; set; } | Indicates whether the object is decorative. |
| [IsEquation](../../aspose.cells.drawing/shape/isequation/) { get; } | Indicates whether the shape only contains an equation. |
| [IsFilled](../../aspose.cells.drawing/shape/isfilled/) { get; set; } | Indicates whether the fill format is visible. |
| [IsFlippedHorizontally](../../aspose.cells.drawing/shape/isflippedhorizontally/) { get; set; } | Gets and sets whether shape is horizontally flipped . |
| [IsFlippedVertically](../../aspose.cells.drawing/shape/isflippedvertically/) { get; set; } | Gets and sets whether shape is vertically flipped . |
| [IsGroup](../../aspose.cells.drawing/shape/isgroup/) { get; } | Indicates whether this shape is a group shape. |
| [IsHidden](../../aspose.cells.drawing/shape/ishidden/) { get; set; } | Indicates whether the object is visible. |
| [IsInGroup](../../aspose.cells.drawing/shape/isingroup/) { get; } | Indicates whether the shape is grouped. |
| [IsLockAspectRatio](../../aspose.cells.drawing/shape/islockaspectratio/) { get; set; } | (**Obsolete.**) True means that aspect ratio of the shape is locked. |
| [IsLocked](../../aspose.cells.drawing/shape/islocked/) { get; set; } | True means the object can not be modified when the sheet is protected. Note that this value is meaningful only if the worksheet or objects in the worksheet are protected. |
| [IsPrintable](../../aspose.cells.drawing/shape/isprintable/) { get; set; } | Indicates whether the object is printable. If False, this shape will not be printed when printing. |
| [IsRichText](../../aspose.cells.drawing/shape/isrichtext/) { get; } | Whether or not the text is rich text. |
| [IsSmartArt](../../aspose.cells.drawing/shape/issmartart/) { get; } | Indicates whether the shape is a smart art. |
| [IsTextWrapped](../../aspose.cells.drawing/shape/istextwrapped/) { get; set; } | Gets and sets the text wrapped type of the shape which contains text. |
| [IsWordArt](../../aspose.cells.drawing/shape/iswordart/) { get; } | Indicates whether this shape is a word art. |
| [Left](../../aspose.cells.drawing/shape/left/) { get; set; } | Represents the horizontal offset of shape from its left column, in unit of pixels. |
| [LeftCM](../../aspose.cells.drawing/shape/leftcm/) { get; set; } | Represents the horizontal offset of shape from its left column, in unit of centimeters. |
| [LeftInch](../../aspose.cells.drawing/shape/leftinch/) { get; set; } | Represents the horizontal offset of shape from its left column, in unit of inches. |
| [LeftInShape](../../aspose.cells.drawing/shape/leftinshape/) { get; set; } | Represents the horizontal offset of shape from the left border of the parent shape, in unit of 1/4000 of width of the parent shape. |
| [LeftToCorner](../../aspose.cells.drawing/shape/lefttocorner/) { get; set; } | Gets and sets the horizonal offset of shape from worksheet left border. |
| [Line](../../aspose.cells.drawing/shape/line/) { get; } | Gets line style |
| [LineFormat](../../aspose.cells.drawing/shape/lineformat/) { get; } | (**Obsolete.**) Returns a MsoLineFormat object that contains line formatting properties for the specified shape. |
| [LinkedCell](../../aspose.cells.drawing/shape/linkedcell/) { get; set; } | Gets or sets the worksheet range linked to the control's value. |
| [LowerDeltaX](../../aspose.cells.drawing/shape/lowerdeltax/) { get; set; } | Gets or sets the shape's horizontal offset from its lower right corner column. |
| [LowerDeltaY](../../aspose.cells.drawing/shape/lowerdeltay/) { get; set; } | Gets or sets the shape's vertical offset from its lower right corner row. |
| [LowerRightColumn](../../aspose.cells.drawing/shape/lowerrightcolumn/) { get; set; } | Represents lower right corner column index. |
| [LowerRightRow](../../aspose.cells.drawing/shape/lowerrightrow/) { get; set; } | Represents lower right corner row index. |
| [MacroName](../../aspose.cells.drawing/shape/macroname/) { get; set; } | Gets and sets the name of macro. |
| [MsoDrawingType](../../aspose.cells.drawing/shape/msodrawingtype/) { get; } | Gets drawing type. |
| [Name](../../aspose.cells.drawing/shape/name/) { get; set; } | Gets and sets the name of the shape. |
| [Paths](../../aspose.cells.drawing/shape/paths/) { get; } | Gets the paths of a custom geometric shape. |
| [Placement](../../aspose.cells.drawing/shape/placement/) { get; set; } | Represents the way the drawing object is attached to the cells below it. The property controls the placement of an object on a worksheet. |
| [Reflection](../../aspose.cells.drawing/shape/reflection/) { get; } | Represents a [`ReflectionEffect`](../reflectioneffect/) object that specifies reflection effect for the chart element or shape. |
| [RelativeToOriginalPictureSize](../../aspose.cells.drawing/shape/relativetooriginalpicturesize/) { get; set; } | Indicates whether shape is relative to original picture size. |
| [Right](../../aspose.cells.drawing/shape/right/) { get; set; } | Represents the width of the shape's horizontal offset from its lower right corner column, in unit of pixels. |
| [RotationAngle](../../aspose.cells.drawing/shape/rotationangle/) { get; set; } | Gets and sets the rotation of the shape. |
| [ShadowEffect](../../aspose.cells.drawing/shape/shadoweffect/) { get; } | Represents a [`ShadowEffect`](../shadoweffect/) object that specifies shadow effect for the chart element or shape. |
| [SoftEdges](../../aspose.cells.drawing/shape/softedges/) { get; set; } | Gets and sets the radius of blur to apply to the edges, in unit of points. |
| [Spid](../../aspose.cells.drawing/shape/spid/) { get; } | Specifies an optional string identifier that an application can use to identify the particular shape. |
| [Spt](../../aspose.cells.drawing/shape/spt/) { get; } | Specifies an optional number that an application can use to associate the particular shape with a defined shape type. |
| [Text](../../aspose.cells.drawing/shape/text/) { get; set; } | Gets and sets the text of this shape. |
| [TextBody](../../aspose.cells.drawing/shape/textbody/) { get; } | Gets and sets the setting of the shape's text. |
| [TextBoxOptions](../../aspose.cells.drawing/shape/textboxoptions/) { get; } | Gets the text information in the shape |
| [TextDirection](../../aspose.cells.drawing/shape/textdirection/) { get; set; } | Gets/Sets the direction of the text flow for this object. |
| [TextEffect](../../aspose.cells.drawing/shape/texteffect/) { get; } | Returns a TextEffectFormat object that contains text-effect formatting properties for the specified shape. Applies to Shape objects that represent WordArt. |
| [TextHorizontalAlignment](../../aspose.cells.drawing/shape/texthorizontalalignment/) { get; set; } | Gets and sets the text horizontal alignment type of the shape. |
| [TextHorizontalOverflow](../../aspose.cells.drawing/shape/texthorizontaloverflow/) { get; set; } | Gets and sets the text horizontal overflow type of the shape which contains text. |
| [TextOptions](../../aspose.cells.drawing/shape/textoptions/) { get; set; } | Represents the text options of the shape. |
| [TextOrientationType](../../aspose.cells.drawing/shape/textorientationtype/) { get; set; } | Gets and sets the text orientation type of the shape. |
| [TextShapeType](../../aspose.cells.drawing/shape/textshapetype/) { get; set; } | Gets and sets the preset text shape type. |
| [TextVerticalAlignment](../../aspose.cells.drawing/shape/textverticalalignment/) { get; set; } | Gets and sets the text vertical alignment type of the shape. |
| [TextVerticalOverflow](../../aspose.cells.drawing/shape/textverticaloverflow/) { get; set; } | Gets and sets the text vertical overflow type of the shape which contains text. |
| [ThreeDFormat](../../aspose.cells.drawing/shape/threedformat/) { get; } | Gets and sets 3d format of the shape. |
| [Title](../../aspose.cells.drawing/shape/title/) { get; set; } | Specifies the title (caption) of the current shape object. |
| [Top](../../aspose.cells.drawing/shape/top/) { get; set; } | Represents the vertical offset of shape from its top row, in unit of pixels. |
| [TopCM](../../aspose.cells.drawing/shape/topcm/) { get; set; } | Represents the vertical offset of shape from its top row, in unit of centimeters. |
| [TopInch](../../aspose.cells.drawing/shape/topinch/) { get; set; } | Represents the vertical offset of shape from its top row, in unit of inches. |
| [TopInShape](../../aspose.cells.drawing/shape/topinshape/) { get; set; } | Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape. |
| [TopToCorner](../../aspose.cells.drawing/shape/toptocorner/) { get; set; } | Gets and sets the vertical offset of shape from worksheet top border, in unit of pixels. |
| [Type](../../aspose.cells.drawing/shape/type/) { get; } | Gets the auto shape type. |
| [UpperDeltaX](../../aspose.cells.drawing/shape/upperdeltax/) { get; set; } | Gets or sets the shape's horizontal offset from its upper left corner column. |
| [UpperDeltaY](../../aspose.cells.drawing/shape/upperdeltay/) { get; set; } | Gets or sets the shape's vertical offset from its upper left corner row. |
| [UpperLeftColumn](../../aspose.cells.drawing/shape/upperleftcolumn/) { get; set; } | Represents upper left corner column index. |
| [UpperLeftRow](../../aspose.cells.drawing/shape/upperleftrow/) { get; set; } | Represents the top row index. |
| [Width](../../aspose.cells.drawing/shape/width/) { get; set; } | Represents the width of shape, in unit of pixels. |
| [WidthCM](../../aspose.cells.drawing/shape/widthcm/) { get; set; } | Represents the width of the shape, in unit of centimeters. |
| [WidthInch](../../aspose.cells.drawing/shape/widthinch/) { get; set; } | Represents the width of the shape, in unit of inch. |
| [WidthInShape](../../aspose.cells.drawing/shape/widthinshape/) { get; set; } | Represents the width of the shape, in unit of 1/4000 of the parent shape. |
| [WidthPt](../../aspose.cells.drawing/shape/widthpt/) { get; set; } | Represents the width of the shape, in unit of point. |
| [WidthScale](../../aspose.cells.drawing/shape/widthscale/) { get; set; } | Gets and sets the width scale, in unit of percent of the original picture width. If the shape is not picture ,the WidthScale property only returns 100; |
| [Worksheet](../../aspose.cells.drawing/shape/worksheet/) { get; } | Gets the [`Worksheet`](../../aspose.cells/worksheet/) object which contains this shape. |
| [X](../../aspose.cells.drawing/shape/x/) { get; set; } | Gets and sets the horizontal offset of shape from worksheet left border,in unit of pixels. |
| [Y](../../aspose.cells.drawing/shape/y/) { get; set; } | Gets and sets the vertical offset of shape from worksheet top border,in unit of pixels. |
| [ZOrderPosition](../../aspose.cells.drawing/shape/zorderposition/) { get; set; } | Returns the position of a shape in the z-order. |

## Methods

| Name | Description |
| --- | --- |
| [AddHyperlink](../../aspose.cells.drawing/shape/addhyperlink/)(string) | Adds a hyperlink to the shape. |
| [AlignTopRightCorner](../../aspose.cells.drawing/shape/aligntoprightcorner/)(int, int) | Moves the picture to the top-right corner. |
| [CalculateTextSize](../../aspose.cells.drawing/shape/calculatetextsize/)() | Recalculate the text area |
| [Characters](../../aspose.cells.drawing/shape/characters/)(int, int) | Returns a Characters object that represents a range of characters within the text. |
| [FitToTextSize](../../aspose.cells.drawing/shape/fittotextsize/)() | Recalculate a text area suitable for displaying all text content. |
| [FormatCharacters](../../aspose.cells.drawing/shape/formatcharacters/)(int, int, Font, StyleFlag) | Formats some characters with the font setting. |
| [GetActualBox](../../aspose.cells.drawing/shape/getactualbox/)() | Get the actual position and size of the shape (after applying rotation, flip, etc.) |
| [GetCharacters](../../aspose.cells.drawing/shape/getcharacters/)() | (**Obsolete.**) Returns all Characters objects that represents a range of characters within the text . |
| [GetConnectionPoints](../../aspose.cells.drawing/shape/getconnectionpoints/)() | Get the connection points |
| [GetInputRange](../../aspose.cells.drawing/shape/getinputrange/)(bool, bool) | Gets the range used to fill the control. |
| [GetLinkedCell](../../aspose.cells.drawing/shape/getlinkedcell/)(bool, bool) | Gets the range linked to the control's value. |
| [GetLockedProperty](../../aspose.cells.drawing/shape/getlockedproperty/)(ShapeLockType) | Gets the value of locked property. |
| virtual [GetResultOfSmartArt](../../aspose.cells.drawing/shape/getresultofsmartart/)() | Converting smart art to grouped shapes. |
| [GetRichFormattings](../../aspose.cells.drawing/shape/getrichformattings/)() | Returns all Characters objects that represents a range of characters within the text . |
| virtual [IsSameSetting](../../aspose.cells.drawing/shape/issamesetting/)(object) | Returns whether the shape is same. |
| [MoveToRange](../../aspose.cells.drawing/shape/movetorange/)(int, int, int, int) | Moves the shape to a specified range. |
| [RemoveActiveXControl](../../aspose.cells.drawing/shape/removeactivexcontrol/)() | Remove activeX control. |
| [RemoveHyperlink](../../aspose.cells.drawing/shape/removehyperlink/)() | Removes the hyperlink of the shape. |
| [SetInputRange](../../aspose.cells.drawing/shape/setinputrange/)(string, bool, bool) | Sets the range used to fill the control. |
| [SetLinkedCell](../../aspose.cells.drawing/shape/setlinkedcell/)(string, bool, bool) | Sets the range linked to the control's value. |
| [SetLockedProperty](../../aspose.cells.drawing/shape/setlockedproperty/)(ShapeLockType, bool) | Set the locked property. |
| [ToFrontOrBack](../../aspose.cells.drawing/shape/tofrontorback/)(int) | Brings the shape to the front or sends the shape to back. |
| [ToImage](../../aspose.cells.drawing/shape/toimage/#toimage)(ImageOrPrintOptions) | Returns the bitmap object of the shape . |
| [ToImage](../../aspose.cells.drawing/shape/toimage/#toimage_2)(Stream, ImageOrPrintOptions) | Saves the shape to a stream. |
| [ToImage](../../aspose.cells.drawing/shape/toimage/#toimage_1)(Stream, ImageType) | Creates the shape image and saves it to a stream in the specified format. |
| [ToImage](../../aspose.cells.drawing/shape/toimage/#toimage_3)(string, ImageOrPrintOptions) | Saves the shape to a file. |
| [UpdateSelectedValue](../../aspose.cells.drawing/shape/updateselectedvalue/)() | Update the selected value by the value of the linked cell. |

### Examples

```csharp
using System;
using Aspose.Cells;
using Aspose.Cells.Drawing;

namespace AsposeCellsExamples
{
    public class DrawingClassShapeDemo
    {
        public static void Run()
        {
            // Initialize a new workbook
            Workbook workbook = new Workbook();

            // Add a rectangle shape to the first worksheet
            Worksheet worksheet = workbook.Worksheets[0];
            Shape shape = worksheet.Shapes.AddRectangle(2, 0, 2, 0, 130, 130);

            // Set some shape properties
            shape.Fill.FillType = FillType.Solid;
            shape.Fill.SolidFill.Color = System.Drawing.Color.LightBlue;
            shape.Line.DashStyle = MsoLineDashStyle.Solid;
            shape.Line.Weight = 2;

            // Save the workbook
            workbook.Save("ShapeDemo.xlsx");
        }
    }
}
```

### See Also

* namespace [Aspose.Cells.Drawing](../../aspose.cells.drawing/)
* assembly [Aspose.Cells](../../)


