<< Click to display table of contents >> TRVGraphic |
A class for objects representing images (bitmaps, PNG, etc.)
Unit [VCL/FMX]: RVType / fmxRVType;
Syntax [VCL]:
TRVGraphic = TGraphic;
Syntax [FMX]:
TRVGraphic = TRVGraphicFM;
TRVGraphicFM = class (TPersistent);
// TRVGraphicFM is defined in fmxRVGraphicsFM unit
In VCL (and LCL), this is the abstract base class type for objects such as icons, bitmaps, and metafiles that can store and display visual images. Classes inherited from TGraphic are used (such as TBitmap, TPngImage, etc.)
In FireMonkey, classes of graphic types are inherited from the abstract TRVGraphicFM class (also accessible as TRVGraphic).
Two classes are inherited from TRVGraphicFM:
▪TRVRasterGraphicFM – wrapper for FireMonkey's TBitmap (fmxRVGraphicsFM unit), also accessible as TRVBitmap
▪TRVSvgImageSkiaFM – wrapper for Skia4Delphi's TSkSvgBrush (fmxRVSvgSkiaFM unit), represents an SVG image
TRVRasterGraphicFM has two properties:
▪Bitmap: TBitmap
▪GraphicType: TRVGraphicType
GraphicType specifies a format for saving this image.
You can use CreateFromBitmap constructor to create a TRVRasterGraphicFM object for the specified TBitmap object.
constructor CreateFromBitmap(ABitmap: TBitmap; SharedBitmap: Boolean);
If SharedBitmap = False, ABitmap will be owned by the created object (and will be freed together with it).
If SharedBitmap = True, a copy of ABitmap will be created and used by the created object.
TRVSvgImageSkiaFM has Svg: TSkSvgBrush property
Note: you can use RVGraphicHandler.GetFileDialogFilter to get a filter for opening and saving dialogs. It returns a filter string containing not only raster formats (registered for TBitmap), but also additional formats (such as SVG), if they are available.