Skip to main content
A newer version of this page is available.

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

[ComVisible(false)]
public static DocumentImageSource FromImage(
    Image image
)

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.

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