ImageEn, unit iexRichEdit

TIERichEdit.SaveSelectedImage

TIERichEdit.SaveSelectedImage


Declaration

function SaveSelectedImage(Dest: TIEBitmap): Boolean; overload;
function SaveSelectedImage(const Filename: string): Boolean; overload;


Description

Allows the selected image in the editor to be output to a bitmap or file.
Result is False if the selection is not an image.
Dest can be nil to check whether the selection is an image.

Note:
To check whether an object is selected ensure SelectionTypes = [slObject].
Method will fail if AllowObjects = False


Example

// Output selected image to a TImageEnView
if IERichEdit1.SaveSelectedImage( ImageEnView1.IEBitmap ) then
  ImageEnView1.Update();

// Output selected image to file
IERichEdit1.SaveSelectedImage( 'D:\Image.jpg' );

// Show error if image not selected (slow)
if IERichEdit1.SaveSelectedImage( nil ) = False then
  ShowMessage( 'Image not selected!' );