Animated Gif

General TRichView support forum. Please post your questions here
Post Reply
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

Animated Gif

Post by max.beliy »

Is it possible to show gif animation in RV?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes.
If you use Delphi 2007 or newer, include RVGifAnimate2007 unit in your project
(for older versions, you need to use third-party gif classes)

Also, you can change RichViewEdit.AnimationMode to rvaniOnFormat to start animation automatically.
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

Post by max.beliy »

It works with standart RVE but with cxTRichViewEdit doesn't work :(
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I confirm the problem: if you set cxrv.Properties.Properties.AnimationMode = rvaniOnFormat at designtime, it does not work.

Fix: open cxTRichView.pas, find procedure TcxCustomTRichViewEdit.Loaded, change it to:

Code: Select all

procedure TcxCustomTRichViewEdit.Loaded;
begin
  inherited;
  ShortRefreshContainer(False);
  if InnerEditor <> nil then
    InnerEditor.Loaded;
end;
This fix will be included in the next update.
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

Post by max.beliy »

Thanks
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

Post by max.beliy »

But still doesn't work :(
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

How do you load the image? The animation is supported if it is loaded as TGifImage, not as DevExpress graphic class (TdxSmartImage)


If you load a gif file using TPicture.LoadFromFile or RVGraphicHandler.LoadFromFile, the most probably, the image is loaded as TdxSmartImage.

You can unregister TdxSmartImage by calling
TPicture.UnregisterGraphicClass(TdxSmartImage);
when the application starts (include dxGDIPlusClasses in "uses").
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

Post by max.beliy »

Thanks TPicture.UnregisterGraphicClass(TdxSmartImage); Works !

Also in some cases can help moving declaration of dx*** units before:
GifImg, RVGifAnimate2007
Post Reply