The reason of this error: TRichView cannot read GIF images from this document, because a graphic class for Gif images is not defined.
This RVF file contains Png and Gif images. While TRichView uses TPngImage for Png (for Delphi 2009+), a class for Gif images is not defined by default.
Possible solutions:
1) Include RVGifAnimate2007 in "uses" of this form. This unit associates the standard TGifImage class with gif images, and adds special support for displaying animated gifs.
So, Png images will be loaded in TPngImage, Gif images will be loaded in TGifImage.
2) You can re-define default classes which TRichView uses for Gif and Png images:
Code: Select all
uses
RVFuncs, RVGrHandler;
...
RVGraphicHandler.SetDefaultGraphicClass(rvgtGif, TdxSmartImage);
RVGraphicHandler.SetDefaultGraphicClass(rvgtPng, TdxPNGImage);
If you decide to use TdxPNGImage, it's better to add RVUSEDXPNGIMAGE to $defines of your project, some special support for TdxPNGImage and TdxSmartImage will be added.
But, actually, I do not see advantages of this approach, and it lacks of gif animation, so I recommend using TPngImage and TGifImage.
3) You can include rvfoIgnoreUnknownPicFmt in RVFOptions. With this option, images of unsupported formats will not generate an error, but will be replaced to RVStyle.InvalidPicture.
PS: if LoadRVF returns false, format the document first, and only then display an error message. Failed LoadRVF can still read a part of RVF document, and it will be unformatted until you call Format.