跳到主要内容

ImageData

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

Properties

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

Type

Object

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", "");
};