
                     PNG Library for Delphi, v2.x
                             Delphi Info

The file "libpng.txt" tells you about the library. It was written for
C programmers, so there may be parts of it that are a little different
from Delphi.  The Delphi data structures, functions and procedures that 
correspond to the C versions documented in "libpng.txt" can be found in
the Pascal file PNGDEF.PAS - look here to see what Delphi parameters are
needed for each function.

The file PngImage.PAS has some "helper functions" to make it easier to
interface to the DLL.  You may find it interesting to check out this
file.  This is also where you can see many of the DLL procedures and
functions in actual use.  A look here is worth more than 1,000 words!


         There are 2 classes that are used to support PNG:

TPngGraphic - A TGraphic derived class.  It provides the ability for all
              Delphi components that use a TGraphic to open PNG files with
              the LoadFromFile method.  For example: with a TImage you
              can call TImage.Picture.LoadFromFile('somefile.PNG'); and
              the TImage will display the PNG file.  For optimal use of
              this class, this file should be installed into a package
              such as the Delphi User's Components (generally
              C:\Program Files\Borland\Delphi 4\Lib\dclusr40.dpk).  This
              can be done by starting Delphi and picking
              "Component | Install Component" from the Delphi menu bar.
              Enter this file as the unit file name and press OK.

TPngImage   - This is the base PNG class.  It is used by TPngGraphic to
              handle the PNG images.  It can also be used on its own to
              load PNG files into memory for program manipulation.  If the
              loaded image contains an Alpha chanel, it is loaded as part
              of the data stream.  The draw method of this class provides
              full support for alpha blending of the image data onto the
              provided canvas.

              To allow for better performance and less memory usage
              TPngImage has a simple refrence counting system in place.
              Look at the Assign method of TPngGraphic for an example of
              its use.  It allows for assigning the image to multiple
              Graphic components and only one copy will remain in memory.
              When the reference count drops to zero the image will
              destroy itself.  If you manually create a TPngImage, you
              should free it by calling its Release method.  Calling the
              GetReference method will increase the reference count and
              return itself.

Png.Dpr     - This is a simple test program that allows opening PNG files
              to test the PNG Graphic unit and LPng.DLL.

To install:

Simply put all the files in a directory somewhere.  Then add PngImage.Pas to
a Delphi package of your choice and your ready to go.

You will also need my LPng.DLL in the \Windows\System directory (or somewhere
else in your path) so that it can be found by all executables.  It does not 
register itself in the registry so it must be in an application's path to be
found.  


