Page 1 of 1

Drop GIF Images

Posted: Mon Sep 26, 2005 3:33 pm
by wvd_vegt
Hi,

Is there a way that RichViewEdit accepts gif images dropped on it?

When i try to drop one it throws an exception that says 'unknown picture fileextension'.

Posted: Mon Sep 26, 2005 3:37 pm
by Sergey Tkachenko
You need to associate the graphic class with the file extenstion.
For example:

Code: Select all

TPicture.RegisterFileFormat('gif', 'Gif Image', TGifImage);
Call this line one time before the first file loading.

(If you use Anders Melander's TGifImage, it should do it itself by default)

Posted: Mon Sep 26, 2005 3:45 pm
by Sergey Tkachenko
Or may be you do not use a graphic class representing TGifImage?

The standard Delphi library does not include support for Gif images, so you need to use thirdparty classes.
One of them - TGifImage by Anders Melander (free, no longer updated)

http://www.torry.net/vcl/graphics/gif/gifimage.exe (original)
http://www.trichview.com/resources/thir ... fimage.zip (update - required)
Include GifImage in uses, and call

Code: Select all

  RegisterClass(TGifImage);
  RV_RegisterHTMLGraphicFormat(TGifImage);
before the first loading.

In order to support animated gifs, include
RVAGifAnimate in uses, and set RichView.AnimationMode=rvaniOnFormat.

Another free gif class can be found in JVCL:
http://jvcl.sourceforge.net
For animation of TJvGIFImage, include RVJvGifAnimate in uses.