Skip to main content
A newer version of this page is available.
All docs
V19.1
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.

SubDocument.InsertImage(DocumentPosition, Image) Method

OBSOLETE

This method has become obsolete. Use the 'Insert' method instead.

Inserts an image into the specified position in the document.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.1.Core.dll

Declaration

[Obsolete("This method has become obsolete. Use the 'DevExpress.XtraRichEdit.API.Native.DocumentImageCollection.Insert(DocumentPosition pos, System.Drawing.Image image)' method instead.")]
DocumentImage InsertImage(
    DocumentPosition pos,
    Image image
)

Parameters

Name Type Description
pos DocumentPosition

A DocumentPosition object representing the position to insert an image.

image Image

A Image object representing the image to insert.

Returns

Type Description
DocumentImage

A DocumentImage object representing an inline image in the document.

Remarks

The InsertImage method inserts an inline picture in the document so that the picture maintains a link to the original image. Any image modifications or its disposal result in a changed or disappearing picture. To prevent this, clone the original image and supply the clone to the InsertImage method, as illustrated in the following code snippet.


richEditControl1.Document.InsertImage(richEditControl1.Document.CaretPosition, (Image)myImage.Clone());

The following code snippets (auto-collected from DevExpress Examples) contain references to the InsertImage(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.

See Also