Description


This method returns image, if the selection consist only of one image. If there is nothing selected, or not only image is selected, this method returns nil. The method returns image owned by RichView, not a copy of it. So do not destroy this image.


This method must be called only when the document is formatted. To format it, call Format method.



function GetSelectedImage: TGraphic;


Example


procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
    g: TGraphic;
begin
    g := Form1.RichEdit1.GetSelectedImage;
    if g <> nil then Form1.Image1.Picture.Assign(g);
end;