|
<< Click to display table of contents >> TCustomRichView.SavePicture |
Saves a picture. This method is used when saving HTML, Markdown, and XML (using RichViewXML component) files.
function SavePicture(DocumentSaveFormat: TRVSaveFormat;
const ImagePrefix, Path: TRVUnicodeString; var ImageSaveNo: Integer;
OverrideImages, InlineImage: Boolean; BackgroundColor: TRVColor;
gr: TRVGraphic; IsBackgroundImage = False): TRVUnicodeString; virtual;
(changed in version 18, 19, 21)
Parameters:
gr – the image to save.
DocumentSaveFormat – output document format, see TRVSaveFormat for possible values.
Path – path where to save the image (the last character must be '\').
If DocumentSaveFormat=rvsfHTML or rvsfMarkdown, and the image format is not registered as a web format, the image is saved as Jpeg.
if InlineImage = False:
ImagesPrefix – the first part of an image file name. An image file name has format ImagesPrefix + <generated number>.
ImageSaveNo – default value of <generated number> (see above). If OverrideImages = True, ImageSaveNo is used. If OverrideImages = False, ImageSaveNo is incremented until the file with this name does not exist.
if InlineImage = True:
The image is not saved in a file, but its base64 representation is returned. It may be used to save the image directly in HTML.
BackgroundColor – color that is used for background (when converting transparent pictures to Jpeg).
IsBackgroundImage should be True if the saved image is used as a background image.
You can use this method in the following events:
▪OnSaveItemToFile (SaveFormat=rvsfHTML or rvsfMarkdown).
If you use this method while saving HTML, it recommended to specify:
▪OverrideImages = True if rvhtmlsioOverrideImages is in HTMLSaveProperties.ImageOptions,
▪ImagesPrefix = HTMLSaveProperties.ImagesPrefix.
If you use this method while saving Markdown, it recommended to specify:
▪OverrideImages = True f rvmdsoOverrideImages is in MarkdownProperties.SaveOptions,
▪ImagesPrefix = MarkdownProperties.ImagesPrefix.
See also: