Aspose::Cells::Drawing::ShapeCollection class

ShapeCollection class

Represents all the shape in a worksheet/chart.

class ShapeCollection

Methods

MethodDescription
AddActiveXControl(ControlType type, int32_t topRow, int32_t top, int32_t leftColumn, int32_t left, int32_t width, int32_t height)Creates an Activex Control.
AddArc(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a ArcShape to the worksheet.
AddAutoShape(AutoShapeType type, int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a AutoShape to the worksheet.
AddAutoShapeInChart(AutoShapeType type, int32_t top, int32_t left, int32_t height, int32_t width)Adds a AutoShape to the chart.
AddButton(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a Button to the worksheet.
AddCheckBox(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a checkbox to the worksheet.
AddComboBox(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a ComboBox to the worksheet.
AddCopy(const Shape& sourceShape, int32_t topRow, int32_t top, int32_t leftColumn, int32_t left)Adds and copy a shape to the worksheet.
AddEquation(int32_t topRow, int32_t top, int32_t leftColumn, int32_t left, int32_t height, int32_t width)Add an equation object to the worksheet.
AddFreeFloatingShape(MsoDrawingType type, int32_t top, int32_t left, int32_t height, int32_t width, const Vector <uint8_t>& imageData, bool isOriginalSize)Adds a free floating shape to the worksheet.Only applies for line/image shape.
AddFreeform(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width, const Vector <ShapePath>& paths)Adds a freeform shape to the worksheet.
AddGroupBox(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a GroupBox to the worksheet.
AddIcons(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width, const Vector <uint8_t>& imageByteData, const Vector <uint8_t>& compatibleImageData)Adds svg image.
AddLabel(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a Label to the worksheet.
AddLabelInChart(int32_t top, int32_t left, int32_t height, int32_t width)Adds a label to the chart.
AddLine(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a LineShape to the worksheet.
AddLinkedPicture(int32_t upperLeftRow, int32_t upperLeftColumn, int32_t height, int32_t width, const U16String& sourceFullName)Add a linked picture.
AddLinkedPicture(int32_t upperLeftRow, int32_t upperLeftColumn, int32_t height, int32_t width, const char16_t* sourceFullName)Add a linked picture.
AddListBox(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a ListBox to the worksheet.
AddOleObject(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width, const Vector <uint8_t>& imageData)Adds an OleObject.
AddOleObjectWithLinkedImage(int32_t upperLeftRow, int32_t upperLeftColumn, int32_t height, int32_t width, const U16String& sourceFullName)Add a linked picture.
AddOleObjectWithLinkedImage(int32_t upperLeftRow, int32_t upperLeftColumn, int32_t height, int32_t width, const char16_t* sourceFullName)Add a linked picture.
AddOval(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a Oval to the worksheet.
AddPicture(int32_t upperLeftRow, int32_t upperLeftColumn, int32_t lowerRightRow, int32_t lowerRightColumn, const Vector <uint8_t>& stream)Adds a picture to the collection.
AddPicture(int32_t upperLeftRow, int32_t upperLeftColumn, const Vector <uint8_t>& stream, int32_t widthScale, int32_t heightScale)Adds a picture to the collection.
AddPictureInChart(int32_t top, int32_t left, const Vector <uint8_t>& stream, int32_t widthScale, int32_t heightScale)Adds a picture to the chart.
AddRadioButton(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a RadioButton to the worksheet.
AddRectangle(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a RectangleShape to the worksheet.
AddScrollBar(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a ScrollBar to the worksheet.
AddShape(MsoDrawingType type, int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a Shape to the worksheet.
AddShapeInChart(MsoDrawingType type, PlacementType placement, int32_t left, int32_t top, int32_t right, int32_t bottom, const Vector <uint8_t>& imageData)Add a shape to chart .All unit is 1/4000 of chart area.
AddShapeInChart(MsoDrawingType type, PlacementType placement, int32_t left, int32_t top, int32_t right, int32_t bottom)Add a shape to chart .All unit is 1/4000 of chart area.
AddShapeInChartByScale(MsoDrawingType type, PlacementType placement, double left, double top, double right, double bottom)Add a shape to chart. All unit is percent scale of chart area.
AddShapeInChartByScale(MsoDrawingType type, PlacementType placement, double left, double top, double right, double bottom, const Vector <uint8_t>& imageData)Add a shape to chart .All unit is 1/4000 of chart area.
AddSignatureLine(int32_t upperLeftRow, int32_t upperLeftColumn, const SignatureLine& signatureLine)Adds a Signature Line to the worksheet.
AddSpinner(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a Spinner to the worksheet.
AddSvg(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width, const Vector <uint8_t>& svgData, const Vector <uint8_t>& compatibleImageData)Adds svg image.
AddTextBox(int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds a text box to the worksheet.
AddTextBoxInChart(int32_t top, int32_t left, int32_t height, int32_t width)Adds a textbox to the chart.
AddTextEffect(MsoPresetTextEffect effect, const U16String& text, const U16String& fontName, int32_t size, bool fontBold, bool fontItalic, int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Inserts a WordArt object.
AddTextEffect(MsoPresetTextEffect effect, const char16_t* text, const char16_t* fontName, int32_t size, bool fontBold, bool fontItalic, int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Inserts a WordArt object.
AddTextEffectInChart(MsoPresetTextEffect effect, const U16String& text, const U16String& fontName, int32_t size, bool fontBold, bool fontItalic, int32_t top, int32_t left, int32_t height, int32_t width)Inserts a WordArt object to the chart.
AddTextEffectInChart(MsoPresetTextEffect effect, const char16_t* text, const char16_t* fontName, int32_t size, bool fontBold, bool fontItalic, int32_t top, int32_t left, int32_t height, int32_t width)Inserts a WordArt object to the chart.
AddWordArt(PresetWordArtStyle style, const U16String& text, int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds preset WordArt since Excel 2007.s.
AddWordArt(PresetWordArtStyle style, const char16_t* text, int32_t upperLeftRow, int32_t top, int32_t upperLeftColumn, int32_t left, int32_t height, int32_t width)Adds preset WordArt since Excel 2007.s.
Clear()Clear all shapes in the worksheet.
CopyCommentsInRange(const ShapeCollection& shapes, const CellArea& ca, int32_t destRow, int32_t destColumn)Copy all comments in the range.
CopyInRange(const ShapeCollection& sourceShapes, const CellArea& ca, int32_t destRow, int32_t destColumn, bool isContained)Copy shapes in the range to destination range.
DeleteInRange(const CellArea& ca)Delete shapes in the range.Comment shapes will not be deleted.
DeleteShape(const Shape& shape)Delete a shape. If the shape is in the group or is a comment shape, it will not be deleted.
Get(int32_t index)Gets the Shape object at the specific index in the list.
Get(const U16String& name)Gets the Shape object by the name of the shape.
Get(const char16_t* name)Gets the Shape object by the name of the shape.
GetCount()
Group(const Vector <Shape>& groupItems)Group the shapes.
IsNull() constChecks whether the implementation object is nullptr.
explicit operator bool() constoperator bool()
operator=(const ShapeCollection& src)operator=
Remove(const Shape& shape)Remove the shape.
RemoveAt(int32_t index)Remove the shape.
ShapeCollection(ShapeCollection_Impl* impl)Constructs from an implementation object.
ShapeCollection(const ShapeCollection& src)Copy constructor.
Ungroup(const GroupShape& group)Ungroups the shape items.
UpdateSelectedValue()Update the selected value by the value of the linked cell or range of the shape.
~ShapeCollection()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook workbook;

//get ShapeCollection
ShapeCollection shapes = workbook.GetWorksheets().Get(0).GetShapes();


//Save the excel file.
workbook.Save("result.xlsx");
Aspose::Cells::Cleanup();

See Also