DocumentImageSource.FromStream(Stream) Method
Creates an image source object from the specified data stream.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v18.2.Core.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
stream | Stream | A Stream containing image data. |
Returns
Type | Description |
---|---|
DocumentImageSource | A DocumentImageSource object representing the image in the document. |
Remarks
The following code sample illustrates how the FromStream can be used to insert an image at the cursor position from the data stream.
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 String = "information.png"
Dim a As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
Dim imageStream As Stream = a.GetManifestResourceStream(imageToInsert)
richEditControl1.Document.Images.Insert(pos, DocumentImageSource.FromStream(imageStream))
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the FromStream(Stream) 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.