public class PictureCollection extends CollectionBase
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");
| Modifier and Type | Method and Description |
|---|---|
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,
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.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 |
camera(int row,
int column,
java.lang.String range)
Takes a photo of the range.
|
void |
clear()
Clear all pictures.
|
Picture |
get(int index)
Gets the
Picture element at the specified index. |
void |
removeAt(int index)
Remove shapes at the specific index
|
public int camera(int row,
int column,
java.lang.String range)
row - The row index of this picture.column - The column index of this picture.range - The area that requires photographypublic int add(int upperLeftRow,
int upperLeftColumn,
int lowerRightRow,
int lowerRightColumn,
java.io.InputStream stream)
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.Picture object index.public int add(int upperLeftRow,
int upperLeftColumn,
int lowerRightRow,
int lowerRightColumn,
java.lang.String fileName)
Example
//add a picture
pictures.add(1, 1, 5, 5, "image.jpg");
upperLeftRow - Upper left row index.upperLeftColumn - Upper left column index.lowerRightRow - Lower right row indexlowerRightColumn - Lower right column indexfileName - Image filename.Picture object index.public int add(int upperLeftRow,
int upperLeftColumn,
java.io.InputStream stream)
upperLeftRow - Upper left row index.upperLeftColumn - Upper left column index.stream - Stream object which contains the image data.Picture object index.public int add(int upperLeftRow,
int upperLeftColumn,
java.lang.String fileName)
Example
//add a picture
pictures.add(1, 1, "image.jpg");
upperLeftRow - Upper left row index.upperLeftColumn - Upper left column index.fileName - Image filename.Picture object index.public int add(int upperLeftRow,
int upperLeftColumn,
java.io.InputStream stream,
int widthScale,
int heightScale)
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.Picture object index.public int add(int upperLeftRow,
int upperLeftColumn,
java.lang.String fileName,
int widthScale,
int heightScale)
Example
//add a picture
pictures.add(1, 1, "image.jpg", 50, 50);
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.Picture object index.public Picture get(int index)
Picture 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);
get in class CollectionBaseindex - The zero based index of the element.public void clear()
Example
//clear
pictures.clear();
clear in class CollectionBasepublic void removeAt(int index)
Example
//add a picture
int index2 = pictures.add(1, 1, "image.png");
//delete
pictures.removeAt(index2);
removeAt in class CollectionBaseindex - The zero-based index of the item to remove.See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.