KwikPeg Manuals
Home
PegPngConvert
Examples
Examples
Index
Index


Members
Styles
(none)
Signals
(none)
Overview Derived from class PegImageConvert

The PegPngConvert class controls the conversion of images from the PNG format to the PegBitmap format used by KwikPeg. The services provided by the PegImageConvert base class are used for color reduction, run length encoding (RLE) compression and transparency, if required.

The PNG graphics format was created as a replacement for the proprietary and patented GIF graphics format. PNG is normally taken as an acronym for "Portable Network Graphics". However, many suggest that PNG is actually an abbreviation for "PNG is Not GIF". The compression ratios, image support and animation features offered by the PNG format are equal to or superior to those provided by the GIF format.

The PegPngConvert class reads a PNG source image and from it produces one or more PegBitmap images.

To use the PegPngConvert class or its derivatives, your KwikPeg configuration must have the following option enabled:
  Images: PNG images

To convert a PNG image, proceed as follows.

  • Create a PegPngConvert object to be used to convert the images.
  • Use it to convert one PNG image into one or more bitmap images.
  • Retrieve the image count from the conversion object using the GetBitmapCount() function.
  • Retrieve each of PegBitmap images from the conversion object using the GetBitmapPointer() function.
  • Delete the conversion object since it is no longer required.
  • Use the bitmap images in your GUI.
  • When the images are no longer required, delete the PegBitmap images using the Screen()->DestroyBitmap(pMap) function.


 See Also

PegBmpConvert

PegGifConvert

PegJpgConvert

PegQuant


Top of page


 Members

Constructors:

PegPngConvert(WORD wId = 0)

This constructor creates an image conversion object to be used to convert an image from PNG image format to the KwikPeg PegBitmap format.

 

Public Functions:

There are few public functions provided by this class for application use other than those available from its PegImageConvert base class.

virtual BOOL ReadImage(
  SIGNED iCount = 1)
virtual BOOL ReadImage(
  PegFile *pFile,
  SIGNED iCount = 1)

This function initiates the conversion process. Review the description provided for the PegImageConvert base class. The iCount parameter specifies the upper limit on the number of embedded images which will be converted from the source PNG image.

If the data streaming method is used for image access, only the first form of this function will be available.

If the file access method is used for image access, only the second form of this function will be available.


Top of page


 Examples

An example which uses the image conversion classes to read and display a collection of BMP, GIF and JPEG images is provided in the KwikPeg installation directory KPGnnn\EXAMPLES\IMGBROWS.




Top of page
KwikPeg Manuals
Home
Index
Index

 
Copyright © 2000-2003