<< 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, the image is saved as Jpeg image (or as bitmap, if the application was compiled with RVDONOTUSEJPEGIMAGE conditional define). You can define image formats that will not be converted to 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 or bitmap).
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 ImagesPrefix = ImagesPrefix parameter of the HTML saving functions, OverrideImages = rvsoOverrideImages in the Options parameter of the HTML saving functions.
If you use this method while saving Markdown, it recommended to specify ImagesPrefix = MarkdownProperties.ImagesPrefix, OverrideImages = rvmdsoOverrideImages in MarkdownProperties.SaveOptions.
See also: