JavaScript is disabled on your browser.
java.lang.Object
CollectionBase
com.aspose.cells.PictureCollection
All Implemented Interfaces: java.lang.Iterable
public class PictureCollection extends CollectionBase
Encapsulates a collection of Picture objects.
Example:
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//get PictureCollection
PictureCollection pictures = workbook.getWorksheets().get(0).getPictures();
//do your business
//Save the excel file.
workbook.save("result.xlsx");
Property Getters/Setters Summary
int
getCount ()
→ inherited from com.aspose.cells.CollectionBase
Picture
get (int)
Gets the Picture element at the specified index.
Method Summary
int
add (int upperLeftRow, int upperLeftColumn, int lowerRightRow, int lowerRightColumn, java.io.InputStream stream)
Adds a picture to the collection.
int
add (int upperLeftRow, int upperLeftColumn, int lowerRightRow, int lowerRightColumn, java.lang.String fileName)
Adds a picture to the collection.
int
add (int upperLeftRow, int upperLeftColumn, java.io.InputStream stream)
Adds a picture to the collection.
int
add (int upperLeftRow, int upperLeftColumn, java.io.InputStream stream, int widthScale, int heightScale)
Adds a picture to the collection.
int
add (int upperLeftRow, int upperLeftColumn, java.lang.String fileName)
Adds a picture to the collection.
int
add (int upperLeftRow, int upperLeftColumn, java.lang.String fileName, int widthScale, int heightScale)
Adds a picture to the collection.
int
add (java.lang.Object value)
→ inherited from com.aspose.cells.CollectionBase
Reserved for internal use.
void
clear ()
Clear all pictures.
boolean
contains (java.lang.Object value)
→ inherited from com.aspose.cells.CollectionBase
Reserved for internal use.
int
indexOf (java.lang.Object value)
→ inherited from com.aspose.cells.CollectionBase
Reserved for internal use.
java.util.Iterator
iterator ()
→ inherited from com.aspose.cells.CollectionBase
void
removeAt (int index)
Remove shapes at the specific index
Property Getters/Setters Detail
getCount → inherited from com.aspose.cells.CollectionBase
public int getCount ()
Gets the Picture element at the specified index.
Parameters: index
- The zero based index of the element.Returns: The element at the specified index. Example:
//get picture collection
//PictureCollection pictures = workbook.Worksheets[0].Pictures;
//add a picture
int index = pictures.add(1, 1, "image.png");
//get the picture
Picture pic = pictures.get(index);
add
public int add (int upperLeftRow, int upperLeftColumn, int lowerRightRow, int lowerRightColumn, java.io.InputStream stream)
Adds a picture to the collection.
Parameters: upperLeftRow
- Upper left row index.upperLeftColumn
- Upper left column index.lowerRightRow
- Lower right row indexlowerRightColumn
- Lower right column indexstream
- Stream object which contains the image data.Returns: Picture object index.
add
public int add (int upperLeftRow, int upperLeftColumn, int lowerRightRow, int lowerRightColumn, java.lang.String fileName)
throws java.lang.Exception
Adds a picture to the collection.
/// Parameters: upperLeftRow
- Upper left row index.upperLeftColumn
- Upper left column index.lowerRightRow
- Lower right row indexlowerRightColumn
- Lower right column indexfileName
- Image filename.Returns: Picture object index.Example:
//add a picture
pictures.add(1, 1, 5, 5, "image.jpg");
add
public int add (int upperLeftRow, int upperLeftColumn, java.io.InputStream stream)
throws java.lang.Exception
Adds a picture to the collection.
Parameters: upperLeftRow
- Upper left row index.upperLeftColumn
- Upper left column index.stream
- Stream object which contains the image data.Returns: Picture object index.
add
public int add (int upperLeftRow, int upperLeftColumn, java.lang.String fileName)
throws java.lang.Exception
Adds a picture to the collection.
Parameters: upperLeftRow
- Upper left row index.upperLeftColumn
- Upper left column index.fileName
- Image filename.Returns: Picture object index.Example:
//add a picture
pictures.add(1, 1, "image.jpg");
add
public int add (int upperLeftRow, int upperLeftColumn, java.io.InputStream stream, int widthScale, int heightScale)
throws java.lang.Exception
Adds a picture to the collection.
Parameters: upperLeftRow
- Upper left row index.upperLeftColumn
- Upper left column index.stream
- Stream object which contains the image data.widthScale
- Scale of image width, a percentage.heightScale
- Scale of image height, a percentage.Returns: Picture object index.
add
public int add (int upperLeftRow, int upperLeftColumn, java.lang.String fileName, int widthScale, int heightScale)
throws java.lang.Exception
Adds a picture to the collection.
Parameters: upperLeftRow
- Upper left row index.upperLeftColumn
- Upper left column index.fileName
- Image filename.widthScale
- Scale of image width, a percentage.heightScale
- Scale of image height, a percentage.Returns: Picture object index.Example:
//add a picture
pictures.add(1, 1, "image.jpg", 50, 50);
clear
public void clear ()
Clear all pictures.
Example:
//clear
pictures.clear();
removeAt
public void removeAt (int index)
Remove shapes at the specific index
Example:
//add a picture
int index2 = pictures.add(1, 1, "image.png");
//delete
pictures.removeAt(index2);
iterator → inherited from com.aspose.cells.CollectionBase
public java.util.Iterator iterator ()
contains → inherited from com.aspose.cells.CollectionBase
public boolean contains (java.lang.Object value)
Reserved for internal use.
add → inherited from com.aspose.cells.CollectionBase
public int add (java.lang.Object value)
Reserved for internal use.
indexOf → inherited from com.aspose.cells.CollectionBase
public int indexOf (java.lang.Object value)
Reserved for internal use.
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.