aspnetcore-js-devexpress-dot-richedit-5688c37e.md
Declares settings of an inline image.
export interface IInsertedInlineImageOptions
The inline image settings are used in the createInline(position, options) method.
The example below demonstrates how to create an inline image with the specified settings in the document, and add a figure caption field and image description below the image.
var imgUrl = 'your-image-URL';
var size = new DevExpress.RichEdit.Size(richEdit.unitConverter.centimetersToTwips(12),
richEdit.unitConverter.centimetersToTwips(8));
var imgDescription = 'An image';
// adds a figure caption and image description below the image
function insertImageDescription(img){
richEdit.document.insertParagraph(img.interval.start);
var positionAfterImg = img.interval.start + 2;
richEdit.document.insertParagraph(positionAfterImg);
richEdit.document.insertText(positionAfterImg, ' ' + img.description);
richEdit.selection.setSelection(positionAfterImg);
richEdit.executeCommand(DevExpress.RichEdit.ReferencesTabCommandId.CreateFigureCaptionField);
richEdit.document.insertParagraph(positionAfterImg);
};
richEdit.document.images.createInline(richEdit.selection.active, {
url: imgUrl,
actualSize: size,
description: imgDescription,
callback: insertImageDescription
});
Specifies the actual size of an inline image in the document.
actualSize: Size
| Type | Description |
|---|---|
| Size |
An object that contains an image size, in twips.
|
var imgUrl = 'your-image-URL';
var size = new DevExpress.RichEdit.Size(richEdit.unitConverter.centimetersToTwips(12),
richEdit.unitConverter.centimetersToTwips(8));
richEdit.document.images.createInline(richEdit.selection.active, {url: imgUrl, actualSize: size});
The image content that is encoded with base64 digits.
base64?: string
| Type | Description |
|---|---|
| string |
The image content.
|
Specifies a function that is called after an image is loaded to the document.
callback?: (image: InlineImage) => void
| Type | Description |
|---|---|
| (image: InlineImage) => void |
The function. The image parameter returns the newly created image.
|
richEdit.document.images.createInline(richEdit.selection.active, {
url: 'your-image-URL', description: 'An image',
callback: (function(img){console.log('The following image has been added: '+ img.description)})});
Specifies an image description.
description?: string
| Type | Description |
|---|---|
| string |
The description.
|
richEdit.document.images.createInline(richEdit.selection.active, {
url: 'your-image-URL',
description: 'An image'
});
Specifies the image URL.
url?: string
| Type | Description |
|---|---|
| string |
The image URL.
|
richEdit.document.images.createInline(richEdit.selection.active, {
url: 'your-image-URL'
});