Back to Devexpress

InsertPictureCommand.execute(imageUrl) Method

aspnet-js-insertpicturecommand-dot-execute-x28-imageurl-x29.md

latest1.5 KB
Original Source

InsertPictureCommand.execute(imageUrl) Method

Executes the InsertPictureCommand command with the specified parameters.

Declaration

ts
execute(
    imageUrl: string,
    callback?: (interval: Interval) => void
): boolean

Parameters

NameTypeDescription
imageUrlstring

A picture’s URL.

| | callback | (interval: Interval) => void |

A function to be executed after a picture is inserted. The interval parameter returns an Interval object that stores the inserted picture’s length and position.

|

Returns

TypeDescription
boolean

true if the command has been successfully executed; false if the command execution has failed.

|

Remarks

javascript
var imageUrl = "https://demos.devexpress.com/ASPxImageAndDataNavigationDemos/Content/Images/landscapes/07.jpg";
richEdit.commands.insertPicture.execute(imageUrl, function (interval) {
   richEdit.selection.intervals = [interval];
   richEdit.commands.changeFloatingObjectTextWrapping.execute({ floatingObjectTextWrapType: ASPx.FloatingObjectTextWrapType.None });
});

See Also

How to: Common Use Cases

InsertPictureCommand Class

InsertPictureCommand Members