Tuesday, October 22, 2019

Working with GIF images in Delphi

Working with GIF images in Delphi Even though Delphi does not natively support GIF image files formats (like BMP or JPEG), there are a few great (free source) components available on the Net, which add the ability to display and manipulate GIF images at run as well as at design time to any Delphi application. Natively, Delphi supports BMP, ICO, WMF, and JPG images. These can be loaded into a graphics-compatible component (such as TImage) and used in an application. Its important to note that, as of Delphi version 2006, GIF format is supported by the VCL. To use animated GIF images you would still need a third-party control. GIFsor Graphics Interchange Formatsare the most widely supported (bitmap) graphics format on the Web, both for still images and for animations. Using in Delphi Natively, Delphi (until version 2007) does not support GIF images, due to some legal copyright issues. What this means, is that when you drop a TImage component on a form, use the Picture Editor (click the ellipsis button in the Value column for properties, such as the Picture property of TImage) to load an image into the TImage, you will not have an option to load GIF images. Fortunately, there are a few third-party implementations on the Internet that provide full support for the GIF format: TGIFImage: free with source (a version of Anders Melanders TGIFImage ported to Delphi 7). Full TGraphic implementation of the GIF graphics format. Reads, writes and displays animated and transparent GIFs and can convert to and from any format supported by TGraphic (e.g TBitmap, TJPEGImage, TIcon, TMetaFile, etc.). Implements the complete GIF87a and GIF89a specification and most common GIF extensions. Advanced features include:Integrates with TPicture to add GIF support to the TImage, TOpenPictureDialog and TSavePictureDialog components. Also works at design time.Imports images with more than 256 colors using color quantization and 6 different dithering methods (e.g. Floyd-​Steinberg).Multi-threaded drawing engine.GIF optimizer reduces the size of your GIFs.GIF to AVI and AVI to GIF converter.GraphicEx image library: an addendum to Delphis Graphics.pas to enable your application to load many common image formats. This library is primarily designed to load images as background ( buttons, forms, toolbars) and textures (DirectX, OpenGL) or for image browsing and editing purposes as long as you dont need to save images. Currently, only TTargaGraphic also supports saving an image. GraphicEx is open source under the Mozilla Public License (MPL). Thats about it. Now all you have to do is to download one of the components and start using gif images in your applications.You can, for example: Store GIF images in a database table. Youll need the GIF images magic numbers.Show GIF graphics as Glyph on a SpeedButton.Store GIF graphics and an HTML file as a  resource  inside am exe.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.