TRVAControlPanel.InitImportPictures, DoneImportPictures, DoImportPicture

<< Click to display table of contents >>

TRVAControlPanel.InitImportPictures, DoneImportPictures, DoImportPicture

Allows using DownloadInterface component for a loading operation, not initialized by RichViewActions.

procedure InitImportPictures(Sender: TrvAction;

  OriginalEvent: TRVImportPictureEvent);
procedure DoneImportPictures;

procedure DoImportPicture(Sender: TCustomRichView;

  const Location: TRVUnicodeString;
  Width, Height: Integer; var Graphic: TGraphic);

Normally, when loading is initiated by an action, DownloadInterface is used automatically. The following actions initializes loading:

TrvActionOpen

TrvActionInsertFile

TrvActionPaste

TrvActionPasteSpecial

However, when loading is not initiated by an action, DownloadInterface is not used. To solve this problem, call InitImportPictures before loading, and DoneImportPicture after, and assign DoImportPicture to OnImportPicture of the target editor.

 

Parameters:

Sender will be used as a parameter of OnDownload event

OriginalEvent is a procedure that is called (if defined) before the RichViewActions procedure to download images.

 

Example:

procedure TMyForm.MyRichViewEditBeforeOleDrop(Sender: TObject);
begin
  MyRVAControlPanel.InitImportPictures(nilnil);
  (Sender as TCustomRichViewEdit).OnImportPicture :=

    MyRVAControlPanel.DoImportPicture;
end;
procedure TForm3.RichViewEdit1AfterOleDrop(Sender: TObject);
begin
  (Sender as TCustomRichViewEdit).OnImportPicture := nil;
  MyRVAControlPanel.DoneImportPictures;
end;