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

ShapeCollection::Get(int32_t) method

Gets the shape object at the specific index.

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

ReturnValue

Examples

    //get the shape
Shape shape = shapes.Get(shapes.GetCount() - 1);

See Also

ShapeCollection::Get(const U16String&) method

Gets the shape object by the shape image.

Shape Aspose::Cells::Drawing::ShapeCollection::Get(const U16String &name)
ParameterTypeDescription
nameconst U16String&

ReturnValue

Examples

    //add a shape
shapes.AddRectangle(2, 0, 2, 0, 130, 130);
//get the shape
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 shape image.

Shape Aspose::Cells::Drawing::ShapeCollection::Get(const char16_t *name)
ParameterTypeDescription
nameconst char16_t*

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