DocumentImageSource.FromImage(Image) Method
Creates an image source object from the specified image.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v18.2.Core.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
image | Image | An Image object. |
Returns
Type | Description |
---|---|
DocumentImageSource | A DocumentImageSource object representing the image in the document. |
Remarks
The following code sample demonstrates how the FromImage method can be used to insert an image at the cursor position in the document.
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)
See Also