Home |
Class PegGifConvert HMI (Human-Machine Interface) Classes |
Class PegGifConvertPegGifConvert is a PegImageConvert derived class for reading and de-compressing GIF input images. Before using PegGifConvert, be sure to read the PegImageConvert base class documentation. PegGifConvert reads GIF image files and produces PegBitmap structures and GIF_IMAGE_INFO structures. The structures produced are not deleted when the PegGifConvert object is deleted, unless you first call the DestroyImages() function before deleting the PegGifConvert object. Normal usage is to create the PegGifConvert object, use it to read and decompress any number of GIF images, and to retrieve the PegBitmap and GIF_IMAGE_INFO structures from the conversion object using the GetBitmapList() and GetImageInfo() functions. Once you have retrieved the output produced, you can delete the conversion object without losing any data. After you are done using or displaying the PegBitmaps produced, you should free the memory associated with the run-time conversion by deleting the PegBitmap and GIF_IMAGE_INFO arrays. typedef struct { PEGUINT wWidth; PEGUINT wHeight; PEGUINT wColors; UCHAR uBackClrIndex; COLORVAL cBackground; UCHAR uAspectRatio; UCHAR IsGif89; } GIF_HEADER; typedef struct { PEGINT xOffset; PEGINT yOffset; PEGUINT wWidth; PEGUINT wHeight; PEGUINT tDelay; UCHAR uHasTrans; UCHAR uTransColor; UCHAR uInputFlag; UCHAR uDisposal; } GIF_IMAGE_INFO; class PegGifConvert : public PegImageConvert { public: PegGifConvert(PEGUINT wId = 0); GIF_HEADER * GetGifHeader(void); GIF_IMAGE_INFO * GetGifInfo(void); void DestroyImages(void); BOOL ReadImage(FILE * fd, PEGINT iCount = 10); }; ConstructorsThe constructor creates an image conversion object. Method GetGifHeaderThis function returns a pointer to the GIF file header information. This can be used to determine additional information about the decoded GIF. There is one GIF_HEADER structure produced for each GIF file converted. The GIF_HEADER structure is deleted when the PegGifConvert object is destroyed. Method GetGifInfoThis function is used to retrieve a pointer to the array of GIF information structures produced during image conversion. There will be one element in the array for each image converted, i.e. one GIF file may contain any number of images and the equivalent number of GIF_IMAGE_INFO structures will be produced. The GIF_IMAGE_INFO structures define local information for each embedded image such as size, relative offset, and delay time. After the application has completed using the image data produced by the conversion object, it must delete the GIF_IMAGE_INFO array to avoid a memory leak.
|