JvGIFAnimator/JvGIFImage and Delphi 2009

By | December 31, 2008

The JVCL has its own TJvGIFImage graphic class. In order to prevent conflicts with Delphi 2009’s TGIFImage class the TJvGIFImage isn’t registered for the *.gif file format. Unfortunately this makes it impossible for the IDE’s PictureEdit dialog to load a GIF file that can be used in TJvGIFAnimator. TJvGIFAnimator has a “property Image: TJvGIFImage” and if the PictureEdit dialog loads a GIF file it uses the graphic class that is registered for the *.gif file extension. And this is Delphi 2009’s TGIFImage. This doesn’t sound like a problem. GIF is GIF, but the problem occurs when the PictureEdit dialog tries to copy the loaded picture into the “Image” property. It compares the graphic class of the property with the loaded one. And they do not match. Both are derived from TGraphics but not from each other. This results in an “Invalid graphic format” exception. And you aren’t able to load a GIF image into the TJvGIFAnimator component in the IDE.

The solution is to register a custom property editor for all TJvGIFImage properties that uses the JVCL PictureEdit dialog which I have adjusted to use the graphic class of the property to load the picture. The changes will be available in the 2009-01-01 daily snapshot.

One thought on “JvGIFAnimator/JvGIFImage and Delphi 2009

Comments are closed.