Home |
Class PegPngConvert HMI (Human-Machine Interface) Classes |
Class PegPngConvertPegPngConvert is a PegImageConvert derived class for reading and decompressing PNG input images. Before using PegPngConvert, be sure to read the PegImageConvert base class documentation. The PNG graphics format was designed as a replacement for the proprietary and patented GIF graphics format. PNG is normally defined as an acronym for Portable Network Graphics, but many say that PNG truly is an abbreviation for "PNG is Not Gif". The compression ratios, image support, and animation support of PNG are all equal to or superior to GIF. PegPngConvert reads PNG image files and produces PegBitmap structures. The structures produced are not deleted when the PegPngConvert object is deleted, unless you first call the DestroyImages() function before deleting the PegPngConvert object. Normal usage is to create the PegPngConvert object, use it to read and decompress any number of PNG images, and to retrieve the PegBitmap structures from the conversion object using the GetBitmapList() function. 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 by calling Screen()->DestroyBitmap(pMap). class PegPngConvert : public PegImageConvert { public: PegPngConvert(PEGUINT wId = 0); BOOL ReadImage(FILE * fd, PEGINT iCount = 1); DWORD Width(void) const; DWORD Height(void) const; DWORD BytesPerRow(void) const; UCHAR BitsPerChannel(void) const; UCHAR ColorType(void) const; UCHAR InterlaceType(void) const; UCHAR NumChannels(void) const; } ConstructorsThe constructor creates an image conversion object. Method ReadImageThis function reads the PNG image from the given file. The iCount parameter defined the maximum number of PegBitmap structures to produce in the event that the PNG file contains multiple images.
|