DocumentImageSource.FromUri(String, IServiceContainer) Method
Creates an image source object from the specified URI string.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v18.2.Core.dll
Declaration
[ComVisible(false)]
public static DocumentImageSource FromUri(
string uri,
IServiceContainer serviceContainer
)
Parameters
Name | Type | Description |
---|---|---|
uri | String | A string of characters identifying the resource in the Internet that can be interpreted as an image. |
serviceContainer | IServiceContainer | An object providing the IUriStreamService interface which allows obtaining a data stream for a specified URI. |
Returns
Type | Description |
---|---|
DocumentImageSource | A DocumentImageSource object representing the image in the document. |
Remarks
Use the RichEditControl instance as the service container, to get images for the specified URI or implement your own service provider. The following example demonstrates how the FromUri method can be used to load an image by its URL.
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 imageUri As String = "http://www.devexpress.com/App_Themes/DX/Common/footer_logo.gif"
richEditControl1.Document.Images.Insert(pos, DocumentImageSource.FromUri(imageUri, richEditControl1))
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the FromUri(String, IServiceContainer) 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.