Skip to main content

ImageData

An object containing the information about the base64 encoded png image.

Type​

Object

Properties​

NameTypeDescription
heightnumberThe image height in pixels.
replaceModeReplaceImageModeSpecifies how to adjust the image object in case of replacing the selected image.
srcstringThe image source in the base64 format.
widthnumberThe image width in pixels.

Example​

window.saveImage = function () {
let imageSrc = imageEditor.toDataURL();
let editorDimension = imageEditor.getCanvasSize();
let width = editorDimension.width;
let height = editorDimension.height;
let imageData = {
"src": imageSrc,
"width": width,
"height": height,
"replaceMode": "original"
};
window.Asc.plugin.executeMethod ("PutImageDataToSelection", [imageData]);
window.Asc.plugin.callCommand("close", "");
};