|
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.
|