Aspose::Cells::Drawing::ShapeCollection::Get method

ShapeCollection::Get(int32_t) method

Gets the Shape object at the specific index in the list.

Shape Aspose::Cells::Drawing::ShapeCollection::Get(int32_t index)
ParameterTypeDescription
indexint32_tThe index.

ReturnValue

Examples

//get the first shape
Shape shape = shapes.Get(0);

See Also

ShapeCollection::Get(const U16String&) method

Gets the Shape object by the name of the shape.

Shape Aspose::Cells::Drawing::ShapeCollection::Get(const U16String &name)
ParameterTypeDescription
nameconst U16String&The name of the shape.

ReturnValue

Examples

    //add a shape
shapes.AddRectangle(2, 0, 2, 0, 130, 130);
//get the shape by the name.
U16String val = u"Rectangle 1";
Shape shape1 = shapes.Get(val);
if (!shape1.IsNull())
{
    //Got the shape named 'Rectangle 1'.
}

See Also

ShapeCollection::Get(const char16_t*) method

Gets the Shape object by the name of the shape.

Shape Aspose::Cells::Drawing::ShapeCollection::Get(const char16_t *name)
ParameterTypeDescription
nameconst char16_t*The name of the shape.

ReturnValue

Examples

    //add a shape
shapes.AddRectangle(2, 0, 2, 0, 130, 130);
//get the shape
Shape shape1 = shapes.Get(u"Rectangle 1");
if (!shape1.IsNull())
{
    //Got the shape named 'Rectangle 1'.
}

See Also