ReplaceCurrentImage
function ReplaceCurrentImage(sImageUrl: string = null, Width: EMU = null, Height: EMU = null): void
Description
Replaces the current image with an image specified.
Parameters
- sImageUrl
string
null The image source where the image to be inserted should be taken from (currently, only internet URL or Base64 encoded images are supported).
The image width in English measure units.
The image height in English measure units.
Returns
void
Try It
var oPresentation = Api.GetPresentation();
var oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
var oDrawing = Api.CreateImage("https://api.onlyoffice.com/content/img/docbuilder/examples/coordinate_aspects.png", 300 * 36000, 150 * 36000);
oSlide.AddObject(oDrawing);
oDrawing.Select();
oPresentation.ReplaceCurrentImage("https://helpcenter.onlyoffice.com/images/Help/GettingStarted/Documents/big/EditDocument.png", 60 * 36000, 35 * 36000);