PictureCollection

PictureCollection class

Encapsulates a collection of Picture objects.

Methods

NameDescription
add(upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, fileName)Adds a picture to the collection. ///
add(upperLeftRow, upperLeftColumn, fileName)Adds a picture to the collection.
add(upperLeftRow, upperLeftColumn, fileName, widthScale, heightScale)Adds a picture to the collection.
camera()
clear()Clear all pictures.
contains()Reserved for internal use.
get(index)Gets the Picture element at the specified index.
get()Reserved for internal use.
getCount()
indexOf()Reserved for internal use.
iterator()
removeAt()Remove shapes at the specific index
addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, stream, callback) (static)Adds a picture to the collection.
addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, stream, callback) (static)Adds a picture to the collection.
addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, stream, widthScale, heightScale, callback) (static)Adds a picture to the collection.

add(upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, fileName)

Adds a picture to the collection. ///

ParameterTypeDescription
upperLeftRowUpper left row index.
upperLeftColumnUpper left column index.
lowerRightRowLower right row index
lowerRightColumnLower right column index
fileNameStringImage filename.

Returns: Number — Number Picture object index.

add(upperLeftRow, upperLeftColumn, fileName)

Adds a picture to the collection.

ParameterTypeDescription
upperLeftRowUpper left row index.
upperLeftColumnUpper left column index.
fileNameStringImage filename.

Returns: Number — Number Picture object index.

add(upperLeftRow, upperLeftColumn, fileName, widthScale, heightScale)

Adds a picture to the collection.

ParameterTypeDescription
upperLeftRowUpper left row index.
upperLeftColumnUpper left column index.
fileNameStringImage filename.
widthScaleNumberScale of image width, a percentage.
heightScaleNumberScale of image height, a percentage.

Returns: Number — Number Picture object index.

camera()

clear()

Clear all pictures.

contains()

Reserved for internal use.

get(index)

Gets the Picture element at the specified index.

ParameterTypeDescription
indexNumberThe zero based index of the element.

Returns: Picture — Picture The element at the specified index.

get()

Reserved for internal use.

getCount()

indexOf()

Reserved for internal use.

iterator()

removeAt()

Remove shapes at the specific index

addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, stream, callback) (static)

Adds a picture to the collection.

ParameterTypeDescription
picturesPictureCollectionThe PictureCollection object
upperLeftRowNumberUpper left row index
upperLeftColumnNumberUpper left column index
lowerRightRowNumberLower right row index
lowerRightColumnNumberLower right column index
streamReadableStreamStream object which contains the image data
callbackCallbackThe callback function

Returns: Picture — Picture Picture object index.

Example:

var aspose = aspose || {};
aspose.cells = require("aspose.cells");
var fs = require("fs");
var workbook = new aspose.cells.Workbook();
var pictures = workbook.getWorksheets().add("picture").getPictures();
var pictureStream = fs.createReadStream("boxing.PNG");
aspose.cells.PictureCollection.addPictureFromStream(pictures, 0, 0, 10, 8, pictureStream,
function(index, err) {
if (err) {
console.log("addPictureFromStream error");
return;
}
console.log("picture add index: " + index);
workbook.save('result.xlsx');
console.log('saved to file');
}
);

addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, stream, callback) (static)

Adds a picture to the collection.

ParameterTypeDescription
picturesPictureCollectionThe PictureCollection object
upperLeftRowNumberUpper left row index
upperLeftColumnNumberUpper left column index
streamReadableStreamStream object which contains the image data
callbackCallbackThe callback function

Returns: Picture — Picture Picture object index.

Example:

var aspose = aspose || {};
aspose.cells = require("aspose.cells");
var fs = require("fs");
var workbook = new aspose.cells.Workbook();
var pictures = workbook.getWorksheets().add("picture").getPictures();
var pictureStream = fs.createReadStream("boxing.PNG");
aspose.cells.PictureCollection.addPictureFromStream(pictures, 0, 0, pictureStream,
function(index, err) {
if (err) {
console.log("addPictureFromStream error");
return;
}
console.log("picture add index: " + index);
workbook.save('result.xlsx');
console.log('saved to file');
}
);

addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, stream, widthScale, heightScale, callback) (static)

Adds a picture to the collection.

ParameterTypeDescription
picturesPictureCollectionThe PictureCollection object
upperLeftRowNumberUpper left row index
upperLeftColumnNumberUpper left column index
streamReadableStreamStream object which contains the image data
widthScaleNumberScale of image width, a percentage
heightScaleNumberScale of image height, a percentage
callbackCallbackThe callback function

Returns: Picture — Picture Picture object index.

Example:

var aspose = aspose || {};
aspose.cells = require("aspose.cells");
var fs = require("fs");
var workbook = new aspose.cells.Workbook();
var pictures = workbook.getWorksheets().add("picture").getPictures();
var pictureStream = fs.createReadStream("boxing.PNG");
aspose.cells.PictureCollection.addPictureFromStream(pictures, 0, 0, pictureStream, 80, 60,
function(index, err) {
if (err) {
console.log("addPictureFromStream error");
return;
}
console.log("picture add index: " + index);
workbook.save('result.xlsx');
console.log('saved to file');
}
);