asposecells.api
Class PictureCollection

Encapsulates a collection of Picture objects.

Property Getters/Setters Summary
methodgetCount()
          
methodget(index)
           Gets the Picture element at the specified index.
 
Method Summary
methodadd(upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, fileName)
           Adds a picture to the collection.
methodadd(upperLeftRow, upperLeftColumn, fileName)
           Adds a picture to the collection.
methodadd(upperLeftRow, upperLeftColumn, fileName, widthScale, heightScale)
           Adds a picture to the collection.
methodaddPictureFromBytes(upperLeftRow, upperLeftColumn, byte_array)
           Adds a picture to the collection.
methodaddPictureFromBytes(upperLeftRow, upperLeftColumn, byte_array, lowerRightRow, lowerRightColumn)
           Adds a picture to the collection.
methodaddPictureFromBytes(upperLeftRow, upperLeftColumn, widthScale, heightScale, byte_array)
           Adds a picture to the collection.
methodclear()
           Clear all pictures.
methodcontains(value)→ inherited from CollectionBase
          Reserved for internal use.
methodget(index)→ inherited from CollectionBase
          Reserved for internal use.
methodindexOf(value)→ inherited from CollectionBase
          Reserved for internal use.
methoditerator()→ inherited from CollectionBase
          
methodremoveAt(index)
           Remove shapes at the specific index
 

Property Getters/Setters Detail

getCount : int 

int getCount()

get : Picture 

Picture get(index)
Gets the Picture element at the specified index.
Parameters:
index - The zero based index of the element.
Returns:
The element at the specified index.

Method Detail

add

int add(upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, fileName)
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
fileName: String - Image filename.
Returns:
Picture object index.

add

int add(upperLeftRow, upperLeftColumn, fileName)
Adds a picture to the collection.
Parameters:
upperLeftRow: int - Upper left row index.
upperLeftColumn: int - Upper left column index.
fileName: String - Image filename.
Returns:
Picture object index.

add

int add(upperLeftRow, upperLeftColumn, fileName, widthScale, heightScale)
Adds a picture to the collection.
Parameters:
upperLeftRow: int - Upper left row index.
upperLeftColumn: int - Upper left column index.
fileName: String - Image filename.
widthScale: int - Scale of image width, a percentage.
heightScale: int - Scale of image height, a percentage.
Returns:
Picture object index.

clear

 clear()
Clear all pictures.

removeAt

 removeAt(index)
Remove shapes at the specific index

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, byte_array, lowerRightRow, lowerRightColumn)
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
lowerRightRow: int - Lower right row index
lowerRightColumn: int - Lower right column index
Returns:
Picture object index.

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).getPictures().addPictureFromBytes(2, 7, byte_array=pic_bytes, lowerRightRow=10, lowerRightColumn=10)
wb.save("wb.xlsx")

jpype.shutdownJVM()
				

addPictureFromBytes

 addPictureFromBytes(upperLeftRow, upperLeftColumn, byte_array)
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
Returns:
Picture object index.

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).getPictures().addPictureFromBytes(2, 2, byte_array=pic_bytes)
wb.save("wb.xlsx")

jpype.shutdownJVM()
				

addPictureFromBytes

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

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).getPictures().addPictureFromBytes(0, 0, widthScale=200, heightScale=150, byte_array=pic_bytes)
wb.save("wb.xlsx")

jpype.shutdownJVM()
				

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.