New background properties
In this update, background image rendering has been completely redesigned.
All image formats
First of all, the component is no longer limited to using Windows bitmaps for its background image. It can now use images in any format supported by Delphi. The old TRichView.BackgroundBitmap property has been replaced with
BackgroundPicture. For VCL and Lazarus, this property is of type TPicture. For FireMonkey, it uses a similar class that emulates TPicture. For ScaleRichView, the analog is TSRichViewEdit.
RVBackgroundPicture.
For tables and table cells, no changes were needed, since they already supported all graphic formats from the beginning.
Position, tiling, sizing
Next, the way background image positioning and repetition are defined has been completely redesigned.
Previously, this was controlled by a single property that listed only the most commonly used positioning options. At that time, there was only one way to stretch an image (non-proportionally to fill the entire window) and only one option to fill the document background rather than the editor window.
In the new version, the design is based on properties inspired by HTML and CSS, with the following principles:
- independent specification of background image position and repetition for horizontal and vertical directions;
- support for scaling images both proportionally and non-proportionally;
- the ability to define sizes and offsets in absolute values or percentages;
- the option to attach the background either to the component itself or to the scrollable content area (with all positioning, repetition, and scaling options available for both attachment modes).
The new properties are in:
Editing
New methods have been added to implement background changes as editing operations, with support for undo and redo.
Compatibility
We made these changes in a way that preserves compatibility with previous versions.
The BackgroundBitmap property still works and allows assigning a Windows bitmap as the background image.
The BackgroundStyle property also works and adjusts BackgroundProperties according to its values.
However, background properties are now stored in RVF in a new format. Older versions of TRichView cannot read them (they will be skipped). The new version can read both the old and the new ways of storing background information in RVF.
Additional components
RichViewActions (commands for building the editor’s user interface) now work with BackgroundPicture instead of BackgroundBitmap, and no longer convert the selected file into a Windows bitmap. However, positioning and repetition properties are still handled in the old way. This will be updated in the next release.
RichViewXML (the component for saving TRichView documents in XML format) also still saves background information using the old method; this will be corrected as well.
New demo project

- background-demo.png (223.73 KiB) Viewed 9755 times
A new demo project has been added in the
Assorted\Graphics\Background folder, showcasing the behavior of all the new BackgroundProperties features. Versions are provided for Delphi VCL, Lazarus, and Delphi FireMonkey. The FireMonkey version comes with a mobile-friendly user interface.