asposecells.api

Class ShapeCollection

Represents all the shape in a worksheet/chart.

Property Getters/Setters Summary
methodgetCount()
methodget(index)
Gets the shape object at the specific index.
methodget(name)
Gets the shape object by the shape image
 
Method Summary
methodaddArc(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a ArcShape to the worksheet.
methodaddAutoShape(type, upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a AutoShape to the worksheet.
methodaddAutoShapeInChart(type, top, left, height, width)
Adds a AutoShape to the chart.
methodaddButton(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a Button to the worksheet.
methodaddCheckBox(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a checkbox to the worksheet.
methodaddComboBox(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a ComboBox to the worksheet.
methodaddCopy(sourceShape, upperLeftRow, top, upperLeftColumn, left)
Adds and copy a shape to the worksheet.
methodaddFreeFloatingShape(type, top, left, height, width, imageData, isOriginalSize)
Adds a free floating shape to the worksheet.Only applies for line/image shape.
methodaddGroupBox(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a GroupBox to the worksheet.
methodaddIcons(upperLeftRow, top, upperLeftColumn, left, height, width, imageByteData, compatibleImageData)
Adds svg image.
methodaddLabel(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a Label to the worksheet.
methodaddLabelInChart(top, left, height, width)
Adds a label to the chart.
methodaddLine(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a LineShape to the worksheet.
methodaddLinkedPicture(upperLeftRow, upperLeftColumn, height, width, sourceFullName)
Add a linked picture.
methodaddListBox(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a ListBox to the worksheet.
methodaddOleObject(upperLeftRow, top, upperLeftColumn, left, height, width, imageData)
methodaddOleObjectWithLinkedImage(upperLeftRow, upperLeftColumn, height, width, sourceFullName)
Add a linked picture.
methodaddOval(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a Oval to the worksheet.
methodaddPictureFromBytes(upperLeftRow, upperLeftColumn, byte_array, widthScale, heightScale)
Adds a picture to the collection.
methodaddPictureFromBytes(upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, byte_array)
Adds a picture to the collection.
methodaddPictureInChartFromBytes(top, left, byte_array, widthScale, heightScale)
Adds a picture to the chart.
methodaddRadioButton(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a RadioButton to the worksheet.
methodaddRectangle(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a RectangleShape to the worksheet.
methodaddScrollBar(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a ScrollBar to the worksheet.
methodaddShape(type, upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a Shape to the worksheet.
methodaddShapeInChart(type, placement, left, top, right, bottom)
Add a shape to chart .All unit is 1/4000 of chart area.
methodaddShapeInChart(type, placement, left, top, right, bottom, imageData)
Add a shape to chart .All unit is 1/4000 of chart area.
methodaddShapeInChartByScale(type, placement, left, top, right, bottom)
Add a shape to chart. All unit is percent scale of chart area.
methodaddShapeInChartByScale(type, placement, left, top, right, bottom, imageData)
Add a shape to chart .All unit is 1/4000 of chart area.
methodaddSpinner(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a Spinner to the worksheet.
methodaddSvg(upperLeftRow, top, upperLeftColumn, left, height, width, svgData, compatibleImageData)
Adds svg image.
methodaddTextBox(upperLeftRow, top, upperLeftColumn, left, height, width)
Adds a text box to the worksheet.
methodaddTextBoxInChart(top, left, height, width)
Adds a textbox to the chart.
methodaddTextEffect(effect, text, fontName, size, fontBold, fontItalic, upperLeftRow, top, upperLeftColumn, left, height, width)
Inserts a WordArt object.
methodaddTextEffectInChart(effect, text, fontName, size, fontBold, fontItalic, top, left, height, width)
Inserts a WordArt object to the chart
methodaddWordArt(style, text, upperLeftRow, top, upperLeftColumn, left, height, width)
Adds preset WordArt since Excel 2007.s
methodclear()
Clear all shapes.
methodcontains(value)
Reserved for internal use.
methodcopyCommentsInRange(shapes, ca, destRow, destColumn)
Copy all comments in the range.
methodcopyInRange(sourceShapes, ca, destRow, destColumn, isContained)
Copy shapes in the range to destination range.
methoddeleteInRange(ca)
Delete shapes in the range.Comment shapes will not be deleted.
methoddeleteShape(shape)
Delete a shape. If the shape is in the group or is a comment shape, it will not be deleted.
methodget(index)
Reserved for internal use.
methodgroup(groupItems)
Group the shapes.
methodindexOf(value)
Reserved for internal use.
methoditerator()
methodremove(shape)
Remove the shape.
methodremoveAt(index)
Remove the shape.
methodungroup(group)
Ungroups the shape items.
methodupdateSelectedValue()
Update the selected value by the value of the linked cell of the shapes.
 

    • Property Getters/Setters Detail

      • getCount : int 

        int getCount()
        
      • get : Shape 

        Shape get(index)
        
        Gets the shape object at the specific index.
        Parameters:
        index -
        Returns:
      • get : Shape 

        Shape get(name)
        
        Gets the shape object by the shape image
        Parameters:
        name -
        Returns:
    • Method Detail

      • addCopy

        Shape addCopy(sourceShape, upperLeftRow, top, upperLeftColumn, left)
        Adds and copy a shape to the worksheet.
        Parameters:
        sourceShape: Shape - Source shape.
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of checkbox from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of textbox from its left column, in unit of pixel.
        Returns:
        The new shape object index.
      • addCheckBox

        CheckBox addCheckBox(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a checkbox to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of checkbox from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of textbox from its left column, in unit of pixel.
        height: int - Height of textbox, in unit of pixel.
        width: int - Width of textbox, in unit of pixel.
        Returns:
        The new CheckBox object index.
      • addTextBox

        TextBox addTextBox(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a text box to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of textbox from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of textbox from its left column, in unit of pixel.
        height: int - Represents the height of textbox, in unit of pixel.
        width: int - Represents the width of textbox, in unit of pixel.
        Returns:
        A TextBox object.
      • addSpinner

        Spinner addSpinner(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a Spinner to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of Spinner from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of Spinner from its left column, in unit of pixel.
        height: int - Represents the height of Spinner, in unit of pixel.
        width: int - Represents the width of Spinner, in unit of pixel.
        Returns:
        A Spinner object.
      • addScrollBar

        ScrollBar addScrollBar(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a ScrollBar to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of ScrollBar from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of ScrollBar from its left column, in unit of pixel.
        height: int - Represents the height of ScrollBar, in unit of pixel.
        width: int - Represents the width of ScrollBar, in unit of pixel.
        Returns:
        A ScrollBar object.
      • addRadioButton

        RadioButton addRadioButton(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a RadioButton to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of RadioButton from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of RadioButton from its left column, in unit of pixel.
        height: int - Represents the height of RadioButton, in unit of pixel.
        width: int - Represents the width of RadioButton, in unit of pixel.
        Returns:
        A RadioButton object.
      • addListBox

        ListBox addListBox(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a ListBox to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of ListBox from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of ListBox from its left column, in unit of pixel.
        height: int - Represents the height of ListBox, in unit of pixel.
        width: int - Represents the width of ListBox, in unit of pixel.
        Returns:
        A ListBox object.
      • addComboBox

        ComboBox addComboBox(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a ComboBox to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of ComboBox from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of ComboBox from its left column, in unit of pixel.
        height: int - Represents the height of ComboBox, in unit of pixel.
        width: int - Represents the width of ComboBox, in unit of pixel.
        Returns:
        A ComboBox object.
      • addGroupBox

        GroupBox addGroupBox(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a GroupBox to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of GroupBox from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of GroupBox from its left column, in unit of pixel.
        height: int - Represents the height of GroupBox, in unit of pixel.
        width: int - Represents the width of GroupBox, in unit of pixel.
        Returns:
        A GroupBox object.
      • addButton

        Button addButton(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a Button to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of Button from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of Button from its left column, in unit of pixel.
        height: int - Represents the height of Button, in unit of pixel.
        width: int - Represents the width of Button, in unit of pixel.
        Returns:
        A Button object.
      • addLabel

        Label addLabel(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a Label to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of Label from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of Label from its left column, in unit of pixel.
        height: int - Represents the height of Label, in unit of pixel.
        width: int - Represents the width of Label, in unit of pixel.
        Returns:
        A Label object.
      • addLabelInChart

        Label addLabelInChart(top, left, height, width)
        Adds a label to the chart.
        Parameters:
        top: int - Represents the vertical offset of label from the upper left corner in units of 1/4000 of the chart area.
        left: int - Represents the vertical offset of label from the upper left corner in units of 1/4000 of the chart area.
        height: int - Represents the height of label, in units of 1/4000 of the chart area.
        width: int - Represents the width of label, in units of 1/4000 of the chart area.
        Returns:
        A new Label object.
      • addTextBoxInChart

        TextBox addTextBoxInChart(top, left, height, width)
        Adds a textbox to the chart.
        Parameters:
        top: int - Represents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area.
        left: int - Represents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area.
        height: int - Represents the height of textbox, in units of 1/4000 of the chart area.
        width: int - Represents the width of textbox, in units of 1/4000 of the chart area.
        Returns:
        A TextBox object.
      • addTextEffectInChart

        Shape addTextEffectInChart(effect, text, fontName, size, fontBold, fontItalic, top, left, height, width)
        Inserts a WordArt object to the chart
        Parameters:
        effect: int - A MsoPresetTextEffect value. The mso preset text effect type.
        text: String - The WordArt text.
        fontName: String - The font name.
        size: int - The font size
        fontBold: boolean - Indicates whether font is bold.
        fontItalic: boolean - Indicates whether font is italic.
        top: int - Represents the vertical offset of shape from the upper left corner in units of 1/4000 of the chart area.
        left: int - Represents the vertical offset of shape from the upper left corner in units of 1/4000 of the chart area.
        height: int - Represents the height of shape, in units of 1/4000 of the chart area.
        width: int - Represents the width of shape, in units of 1/4000 of the chart area.
        Returns:
        Returns a Shape object that represents the new WordArt object.
      • addTextEffect

        Shape addTextEffect(effect, text, fontName, size, fontBold, fontItalic, upperLeftRow, top, upperLeftColumn, left, height, width)
        Inserts a WordArt object.
        Parameters:
        effect: int - A MsoPresetTextEffect value. The mso preset text effect type.
        text: String - The WordArt text.
        fontName: String - The font name.
        size: int - The font size
        fontBold: boolean - Indicates whether font is bold.
        fontItalic: boolean - Indicates whether font is italic.
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of shape from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of shape from its left column, in unit of pixel.
        height: int - Represents the height of shape, in unit of pixel.
        width: int - Represents the width of shape, in unit of pixel.
        Returns:
        Returns a Shape object that represents the new WordArt object.
      • addWordArt

        Shape addWordArt(style, text, upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds preset WordArt since Excel 2007.s
        Parameters:
        style: int - A PresetWordArtStyle value. The preset WordArt Style.
        text: String - The text.
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of shape from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of shape from its left column, in unit of pixel.
        height: int - Represents the height of shape, in unit of pixel.
        width: int - Represents the width of shape, in unit of pixel.
        Returns:
      • addRectangle

        RectangleShape addRectangle(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a RectangleShape to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of RectangleShape from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of RectangleShape from its left column, in unit of pixel.
        height: int - Represents the height of RectangleShape, in unit of pixel.
        width: int - Represents the width of RectangleShape, in unit of pixel.
        Returns:
        A RectangleShape object.
      • addOval

        Oval addOval(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a Oval to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of Oval from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of Oval from its left column, in unit of pixel.
        height: int - Represents the height of Oval, in unit of pixel.
        width: int - Represents the width of Oval, in unit of pixel.
        Returns:
        A Oval object.
      • addLine

        LineShape addLine(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a LineShape to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of LineShape from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of LineShape from its left column, in unit of pixel.
        height: int - Represents the height of LineShape, in unit of pixel.
        width: int - Represents the width of LineShape, in unit of pixel.
        Returns:
        A LineShape object.
      • addFreeFloatingShape

        Shape addFreeFloatingShape(type, top, left, height, width, imageData, isOriginalSize)
        Adds a free floating shape to the worksheet.Only applies for line/image shape.
        Parameters:
        type: int - A MsoDrawingType value. The shape type.
        top: int - Represents the vertical offset of shape from the worksheet's top row, in unit of pixel.
        left: int - Represents the horizontal offset of shape from the worksheet's left column, in unit of pixel.
        height: int - Represents the height of LineShape, in unit of pixel.
        width: int - Represents the width of LineShape, in unit of pixel.
        imageData: byte[] - The image data,only applies for the picture.
        isOriginalSize: boolean - Whether the shape use original size if the shape is image.
        Returns:
      • addShapeInChart

        Shape addShapeInChart(type, placement, left, top, right, bottom, imageData)
        Add a shape to chart .All unit is 1/4000 of chart area.
        Parameters:
        type: int - A MsoDrawingType value. The drawing type.
        placement: int - A PlacementType value. the placement type.
        left: int - In unit of 1/4000 chart area width.
        top: int - In unit of 1/4000 chart area height.
        right: int - In unit of 1/4000 chart area width.
        bottom: int - In unit of 1/4000 chart area height.
        imageData: byte[] - If the shape is not a picture or ole object,imageData should be null.
      • addShapeInChart

        Shape addShapeInChart(type, placement, left, top, right, bottom)
        Add a shape to chart .All unit is 1/4000 of chart area.
        Parameters:
        type: int - A MsoDrawingType value. The drawing type.
        placement: int - A PlacementType value. the placement type.
        left: int - In unit of 1/4000 chart area width.
        top: int - In unit of 1/4000 chart area height.
        right: int - In unit of 1/4000 chart area width.
        bottom: int - In unit of 1/4000 chart area height.
      • addShapeInChartByScale

        Shape addShapeInChartByScale(type, placement, left, top, right, bottom)
        Add a shape to chart. All unit is percent scale of chart area.
        Parameters:
        type: int - A MsoDrawingType value. The drawing type.
        placement: int - A PlacementType value. the placement type.
        left: float - Unit is percent scale of chart area width.
        top: float - Unit is percent scale of chart area height.
        right: float - Unit is percent scale of chart area width.
        bottom: float - Unit is percent scale of chart area height.
      • addShapeInChartByScale

        Shape addShapeInChartByScale(type, placement, left, top, right, bottom, imageData)
        Add a shape to chart .All unit is 1/4000 of chart area.
        Parameters:
        type: int - A MsoDrawingType value. The drawing type.
        placement: int - A PlacementType value. the placement type.
        left: float - Unit is percent scale of chart area width.
        top: float - Unit is percent scale of chart area height.
        right: float - Unit is percent scale of chart area width.
        bottom: float - Unit is percent scale of chart area height.
        imageData: byte[] - If the shape is not a picture or ole object,imageData should be null.
      • addArc

        ArcShape addArc(upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a ArcShape to the worksheet.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of ArcShape from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of ArcShape from its left column, in unit of pixel.
        height: int - Represents the height of ArcShape, in unit of pixel.
        width: int - Represents the width of ArcShape, in unit of pixel.
        Returns:
        A ArcShape object.
      • addShape

        Shape addShape(type, upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a Shape to the worksheet. The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox
        Parameters:
        type: int - A MsoDrawingType value. Mso drawing type.
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of Shape from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of Shape from its left column, in unit of pixel.
        height: int - Represents the height of Shape, in unit of pixel.
        width: int - Represents the width of Shape, in unit of pixel.
        Returns:
        A Shape object.
      • addAutoShape

        Shape addAutoShape(type, upperLeftRow, top, upperLeftColumn, left, height, width)
        Adds a AutoShape to the worksheet. The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox
        Parameters:
        type: int - A AutoShapeType value. Auto shape type.
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of Shape from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - Represents the horizontal offset of Shape from its left column, in unit of pixel.
        height: int - Represents the height of Shape, in unit of pixel.
        width: int - Represents the width of Shape, in unit of pixel.
        Returns:
        A Shape object.
      • addAutoShapeInChart

        Shape addAutoShapeInChart(type, top, left, height, width)
        Adds a AutoShape to the chart. The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox
        Parameters:
        type: int - A AutoShapeType value. Auto shape type.
        top: int - Represents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area.
        left: int - Represents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area.
        height: int - Represents the height of textbox, in units of 1/4000 of the chart area.
        width: int - Represents the width of textbox, in units of 1/4000 of the chart area.
        Returns:
        Returns a shape object.
      • addSvg

        Picture addSvg(upperLeftRow, top, upperLeftColumn, left, height, width, svgData, compatibleImageData)
        Adds svg image.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of shape from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - The horizontal offset of shape from its left column, in unit of pixel.
        height: int - The height of shape, in unit of pixel.
        width: int - The width of shape, in unit of pixel.
        svgData: byte[] - The svg image data.
        compatibleImageData: byte[] - Converted image data from svg in order to be compatible with Excel 2016 or lower versions.
        Returns:
      • addIcons

        Picture addIcons(upperLeftRow, top, upperLeftColumn, left, height, width, imageByteData, compatibleImageData)
        Adds svg image.
        Parameters:
        upperLeftRow: int - Upper left row index.
        top: int - Represents the vertical offset of shape from its left row, in unit of pixel.
        upperLeftColumn: int - Upper left column index.
        left: int - The horizontal offset of shape from its left column, in unit of pixel.
        height: int - The height of shape, in unit of pixel.
        width: int - The width of shape, in unit of pixel.
        imageByteData: byte[] - The image byte data.
        compatibleImageData: byte[] - Converted image data from svg in order to be compatible with Excel 2016 or lower versions.
        Returns:
      • addLinkedPicture

        Picture addLinkedPicture(upperLeftRow, upperLeftColumn, height, width, sourceFullName)
        Add a linked picture.
        Parameters:
        upperLeftRow: int - Upper left row index.
        upperLeftColumn: int - Upper left column index.
        height: int - The height of the shape. In unit of pixels
        width: int - The width of the shape. In unit of pixels
        sourceFullName: String - The path and name of the source file for the linked image
        Returns:
        Picture Picture object.
      • addOleObjectWithLinkedImage

        OleObject addOleObjectWithLinkedImage(upperLeftRow, upperLeftColumn, height, width, sourceFullName)
        Add a linked picture.
        Parameters:
        upperLeftRow: int - Upper left row index.
        upperLeftColumn: int - Upper left column index.
        height: int - The height of the shape. In unit of pixels
        width: int - The width of the shape. In unit of pixels
        sourceFullName: String - The path and name of the source file for the linked image
        Returns:
        Picture Picture object.
      • addOleObject

        OleObject addOleObject(upperLeftRow, top, upperLeftColumn, left, height, width, imageData)
        Parameters:
        upperLeftRow: int -
        top: int -
        upperLeftColumn: int -
        left: int -
        height: int -
        width: int -
        imageData: byte[] -
        Returns:
      • copyCommentsInRange

         copyCommentsInRange(shapes, ca, destRow, destColumn)
        Copy all comments in the range.
        Parameters:
        shapes: ShapeCollection - The source shapes.
        ca: CellArea - The source range.
        destRow: int - The dest range start row.
        destColumn: int - The dest range start column.
      • copyInRange

         copyInRange(sourceShapes, ca, destRow, destColumn, isContained)
        Copy shapes in the range to destination range.
        Parameters:
        sourceShapes: ShapeCollection - Source shapes.
        ca: CellArea - The source range.
        destRow: int - The dest row index of the dest range.
        destColumn: int - The dest column of the dest range.
        isContained: boolean - Whether only copy the shapes which are contained in the range. If true,only copies the shapes in the range. Otherwise,it works as MS Office.
      • deleteInRange

         deleteInRange(ca)
        Delete shapes in the range.Comment shapes will not be deleted.
        Parameters:
        ca: CellArea - The range.If the shapes are contained in the range, they will be removed.
      • deleteShape

         deleteShape(shape)
        Delete a shape. If the shape is in the group or is a comment shape, it will not be deleted.
        Parameters:
        shape: Shape -
      • group

        GroupShape group(groupItems)
        Group the shapes. The shape in the groupItems should not be grouped. The shape must be in this Shapes collection.
        Parameters:
        groupItems: Shape[] - the group items.
        Returns:
        Return the group shape.
      • ungroup

         ungroup(group)
        Ungroups the shape items. If the group shape is grouped by another group shape,nothing will be done.
        Parameters:
        group: GroupShape - The group shape.
      • removeAt

         removeAt(index)
        Remove the shape.
        Parameters:
        index: int - The index of the shape.
      • remove

         remove(shape)
        Remove the shape.
        Parameters:
        shape: Shape -
      • clear

         clear()
        Clear all shapes.
      • updateSelectedValue

         updateSelectedValue()
        Update the selected value by the value of the linked cell of the shapes.
      • iterator

        Iterator iterator()
      • get

        Object get(index)
        Reserved for internal use.
      • contains

        boolean contains(value)
        Reserved for internal use.
      • indexOf

        int indexOf(value)
        Reserved for internal use.
      • addPictureFromBytes

         addPictureFromBytes(upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, byte_array)
        Adds a picture to the collection.
        Parameters:
        upperLeftRow: int - Upper left row index
        upperLeftColumn: int - Upper left column index
        lowerRightRow: int - Lower right row index
        lowerRightColumn: int - Lower right column index
        byte_array: bytes - The byte array
        Returns:
        Returns a Picture objct

        Example:

        import jpype
        import asposecells
        jpype.startJVM()
        from asposecells.api import *
        
        wb = Workbook(FileFormatType.XLSX)
        with open('cells.png', 'rb') as pic:
            pic_bytes = pic.read()
            wb.getWorksheets().get(0).getShapes().addPictureFromBytes(2, 7, lowerRightRow=10, lowerRightColumn=10, byte_array=pic_bytes)
        wb.save("wb.xlsx")
        
        jpype.shutdownJVM()
        				
      • addPictureFromBytes

         addPictureFromBytes(upperLeftRow, upperLeftColumn, byte_array, widthScale, heightScale)
        Adds a picture to the collection.
        Parameters:
        upperLeftRow: int - Upper left row index
        upperLeftColumn: int - Upper left column index
        byte_array: bytes - The byte array
        widthScale: int - Scale of image width, a percentage
        heightScale: int - Scale of image height, a percentage
        Returns:
        Returns a Picture objct

        Example:

        import jpype
        import asposecells
        jpype.startJVM()
        from asposecells.api import *
        
        wb = Workbook(FileFormatType.XLSX)
        with open('cells.png', 'rb') as pic:
            pic_bytes = pic.read()
            wb.getWorksheets().get(0).getShapes().addPictureFromBytes(2, 0, byte_array=pic_bytes, widthScale=200, heightScale=150)
        wb.save("wb.xlsx")
        
        jpype.shutdownJVM()
        				
      • addPictureInChartFromBytes

         addPictureInChartFromBytes(top, left, byte_array, widthScale, heightScale)
        Adds a picture to the chart.
        Parameters:
        top: int - Represents the vertical offset of shape from the upper left corner in units of 1/4000 of the chart area
        left: int - Represents the horizontal offset of shape from the upper left corner in units of 1/4000 of the chart area
        byte_array: bytes - The byte array
        widthScale: int - Scale of image width, a percentage
        heightScale: int - Scale of image height, a percentage
        Returns:
        Returns a Picture objct

        Example:

        import jpype
        import asposecells
        jpype.startJVM()
        from asposecells.api import *
        
        wb = Workbook('Book2.xlsx')
        shapes = wb.getWorksheets().get("Chart").getCharts().get(0).getShapes()
        with open('cells.png', 'rb') as pic:
            picture = shapes.addPictureInChartFromBytes(1, 1, pic.read(), 10, 5)
        wb.save("wb.xlsx")
        
        jpype.shutdownJVM()