DocumentImageCollection.Insert(DocumentPosition, Image) Method
Inserts an image at the specified position in the document.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v18.2.Core.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
pos | DocumentPosition | A DocumentPosition object specifying the position to insert an image. |
image | Image | A Image object specifying the image to insert. |
Returns
Type | Description |
---|---|
DocumentImage | A DocumentImage object specifying the inline image in the document. |
Remarks
To inserts a picture as a floating object, use the ShapeCollection.InsertPicture method.
Example
This sample code inserts a Image object into the document. The image is obtained from the ImageCollection control.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/inline-pictures-in-richeditcontrol-e1525
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native
' ...
Dim pos As DocumentPosition = richEditControl1.Document.CaretPosition
Dim imageToInsert As Image = imageCollection1.Images(3)
richEditControl1.Document.Images.Insert(pos, imageToInsert)
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Insert(DocumentPosition, Image) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.