[fpc-pascal]How to load a png image

Michalis Kamburelis michalis at camelot.homedns.org
Sun Dec 21 23:26:08 CET 2003


Karim wrote:
> Hello 
> 
> I want to know, how to load a png image with freepascal ?
> There is a png libpng package shipped with FreePascal, but I cannot find
> any examples or docs. 

Pascal unit Libpng is just a wrapper that calls functions from 
libpng.so. Documentation for libpng is available at the official page of 
libpng, http://www.libpng.org, you will most likely be interested in 
this document:
   http://www.libpng.org/pub/png/libpng-1.2.5-manual.html

> Or are there any onther simple image formats that can be loaded into a
> freepascal program ?

Well, everything can be loaded into a Pascal program...

The simplest possible image format is ppm (it is just a small header + 
array of RGB values for each pixel) - if you are on UNIX-like system and 
have installed proper documentation then
   man ppm
should give you a simple specification of ppm format. You may also take 
a look at it's cousins, pbm, pgm and the most general one, pnm.

Regards,
Michalis





More information about the fpc-pascal mailing list