Aspose::Cells::Drawing::ShapeCollection::AddFreeFloatingShape method

ShapeCollection::AddFreeFloatingShape method

Adds a free floating shape to the worksheet.Only applies for line/image shape.

Shape Aspose::Cells::Drawing::ShapeCollection::AddFreeFloatingShape(MsoDrawingType type, int32_t top, int32_t left, int32_t height, int32_t width, const Vector<uint8_t> &imageData, bool isOriginalSize)
ParameterTypeDescription
typeMsoDrawingTypeThe shape type.
topint32_tRepresents the vertical offset of shape from the worksheet’s top row, in unit of pixel.
leftint32_tRepresents the horizontal offset of shape from the worksheet’s left column, in unit of pixel.
heightint32_tRepresents the height of LineShape, in unit of pixel.
widthint32_tRepresents the width of LineShape, in unit of pixel.
imageDataconst Vector <uint8_t>&The image data,only applies for the picture.
isOriginalSizeboolWhether the shape use original size if the shape is image.

ReturnValue

Examples

//add a line
Vector<uint8_t> lineImageData{ 0 };//Adding lines does not require image data(Note: You need to read the data into this variable.)
Shape floatingShape_Line = shapes.AddFreeFloatingShape(MsoDrawingType::Line, 100, 100, 100, 50, lineImageData, false);

//add a picture
Vector<uint8_t> imgData{ 0 };//Gets image data into 'imgData' from file(e.g image.jpg . Note: You need to read the data into this variable.).
Shape floatingShape_Picture = shapes.AddFreeFloatingShape(MsoDrawingType::Picture, 200, 100, 100, 50, imgData, false);

See Also