Skia is a cross-platform Google's graphic library.
Skia4Delphi allows using Skia in Delphi, starting from Delphi XE7.
Skia4Delphi is included in RAD Studio 12 by default. For older versions of Delphi, you can download it from GetIt package manager, or, better, from
https://github.com/skia4delphi/skia4delphi/releases (v6.0.0 is needed for TRichView)
Skia4Delphi in FireMonkey
To use Skia4Delphi features with TRichView, include fmxRVSkiaFM unit in your project.
1. Better canvases
Skia4Delphi implements its own canvases for all platforms. These canvases usually work faster and provide better drawing quality than the standard FireMonkey canvases (especially on mobile platforms). TRichView 22 supports Skia4Delphi canvases. No special code is needed, just add fmxRVSkiaFM unit in your project.
2. SVG graphics
SVG (Scalable Vector Graphics) is an XML-based vector image format.
Previously, TRichView for FireMonkey supported only raster images. TRVGraphic (that was also available as TRVBitmap) was a wrapper for FireMonkey's TBitmap.
In this version,
TRVGraphic is an abstract class , the actual graphic classes are inherited from it:
- TRVRasterGraphicFM (also available as TRVBitmap) - wrapper for TBitmap
- TRVSvgImageSkiaFM - uses Skia4Delphi to draw SVG images.
- TRichView-Skia-SVG.png (99.15 KiB) Viewed 76929 times
Note: previously, to get a filter string for an image insertion dialog, you could use TBitmapCodecManager.GetFilterString.
Since TRichView 12, I recommend to use RVGraphicHandler.GetFileDialogFilter instead. It includes all formats supported by TBitmapCodecManager, and also additional formats (like SVG), if they are available.
3. More graphic formats
Skia4Delphi adds support for additional raster graphic formats, including WebP.
WebP is a raster graphics file format developed by Google intended as a replacement for JPEG, PNG, and GIF file formats. It supports both lossy and lossless compression and alpha transparency.
With Skia4Delphi, you can use WebP images in TRichView documents.
4. PDF saving
Two new methods were added:
TRVPrint.SavePDF and
TRVReportHelper.SavePDF.
While these methods were added for all versions of TRichView, they work only if PDF saving engine is available. You can check it by calling CanSavePDF method.
Currently, PDF saving by these methods is implemented only in FireMonkey + Skia4Delphi.
This is a basic saving. Creating PDF bookmarks, links and outlines is not possible.