TCustomRichViewEdit.PasteGraphic [Windows]

<< Click to display table of contents >>

TCustomRichViewEdit.PasteGraphic [Windows]

Inserts an image from the Clipboard at the caret position.

function PasteGraphic(TextAsName: Boolean;
  PreferredFormat: TRVGraphicType = rvgtOther): Boolean;

(introduced in version 25)

This method pastes an image from the Clipboard. It supports clipboard formats named after the image MIME type, such as "image/jpeg". In addition, it supports a format named "PNG" (used by Chrome).

First, the method attempts to paste the graphic in the format specified by the PreferredFormat parameter (if it is not equal to rvgtOther). If this is not possible, it iterates through the supported graphic formats.

if TextAsName=True and the Clipboard contains text, it sets name of this item to the text from the Clipboard (warning: if you want to save this document to RVF, names of items should not contain CR and LF characters).

Method type: editstyle editing-style method for insertion.

Supported platforms: Windows (VCL, LCL, FireMonkey)

Return value:

True, if an image was inserted.

See also methods:

Paste;

PasteBitmap;

PasteGraphicFile;

PasteMetafile;

InsertPicture.

See also properties:

DefaultPictureVAlign.

See also events:

OnAssignImageFileName

See also:

RichView and Clipboard.