rvico TRichView Reference | TRichView

TCustomRichView.OnSaveImage2

Top  Previous  Next

Occurs when TRichView saves image to HTML file or stream.

type

  TRVSaveImageEvent2 = procedure (Sender: TCustomRichView;

    Graphic: TGraphic; SaveFormat: TRVSaveFormat;

    const Path, ImagePrefix: String;

    var ImageSaveNo: Integer; var Location: String;

    var DoDefault: Boolean) of object;

 

property OnSaveImage2: TRVSaveImageEvent2;

(introduced in version 1.8; "hidden" parameters are added in version 14)

This event is alternative to OnHTMLSaveImage. It is more easy to use, because the image is available in the Graphic parameter (in OnHTMLSaveImage, you need to extract image from the item or RVData yourself). Besides, this event has ImagePrefix and ImageSaveNo parameters, so you do not need to store them in global variables.

OnSaveImage2 is not called if:

rvsoUseItemImageFileNames is included in the Options parameter of SaveHTML/SaveHTMLEx and value of rvespImageFileName item property is not empty;

DoDefault parameter of OnHTMLSaveImage was set to False for this image.

 

Input parameters:

Graphic – image to save.

SaveFormat is equal to rvsfHTML.

Path – destination directory of HTML file (or Path parameter of SaveHTMLToStream/SaveHTMLToStreamEx)

ImagePrefix – recommended beginning of image file name (this is ImagesPrefix parameter of SaveHTMLToStream/SaveHTMLToStreamEx)

ImageSaveNo – value that you can use to create unique file names (see GetNextFileName method in the description of OnHTMLSaveImage).

"Hidden" input parameters:

Sender.Style.RVData (must be typecasted to TCustomRVData) document containing the item that is being saved to an image; it can be Sender.RVData, table cell, or RVData of cell inplace-editor.

Sender.Style.ItemNo index of this item inside Sender.Style.RVData. If this event is called for background image (document or cell), ItemNo=-1.

Output parameters:

Location set this parameter to file name of image where you saved it. This string will be inserted in HTML file.

DoDefault set to False if you saved this image yourself. Otherwise, the default image saving procedure will be called.

 

Note: when saving images from image-lists (bullets, hotspots, list markers with images), TRichView creates a temporal TBitmap and passes it to this event.

 

See also events:

OnHTMLSaveImage;

OnSaveItemToFile.

See also:

Export to HTML.


TRichView © trichview.com