Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IInsertedInlineImageOptions Interface

Declares settings of an inline image.

#Declaration

TypeScript
export interface IInsertedInlineImageOptions

#Remarks

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

#Properties

#actualSize Property

Specifies the actual size of an inline image in the document.

#Declaration

TypeScript
actualSize: Size

#Property Value

Type Description
Size

An object that contains an image size, in twips.

#Remarks

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

#base64 Property

The image content that is encoded with base64 digits.

#Declaration

TypeScript
base64?: string

#Property Value

Type Description
string

The image content.

#callback Property

Specifies a function that is called after an image is loaded to the document.

#Declaration

TypeScript
callback?: (image: InlineImage) => void

#Property Value

Type Description
(image: InlineImage) => void

The function. The image parameter returns the newly created image.

#Remarks

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

#description Property

Specifies an image description.

#Declaration

TypeScript
description?: string

#Property Value

Type Description
string

The description.

#Remarks

richEdit.document.images.createInline(richEdit.selection.active, {
  url: 'your-image-URL', 
  description: 'An image'
});

#url Property

Specifies the image URL.

#Declaration

TypeScript
url?: string

#Property Value

Type Description
string

The image URL.

#Remarks

richEdit.document.images.createInline(richEdit.selection.active, {
  url: 'your-image-URL'
});