[Lazarus] Using libjpeg

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Mar 31 11:24:21 CEST 2016


On Thu, 31 Mar 2016 09:49:44 +0200 (CEST)
Michael Van Canneyt <michael at freepascal.org> wrote:

> 
> 
> On Wed, 30 Mar 2016, Aradeonas wrote:
> 
> > Hi,
> >
> > I want use libjpeg and I found pasjpeg package in fpc that contains
> > jpeglib.pas unit 

Unit jpeglib does not use libjpeg.


> > but I coudnt find a working demo to know how load a
> > jpeg file and show it.
> > Can anyone point me to a better direction?
> 
> pasjpeg is very low-level. Why not use tfpimage ? 
> use the fpimage unit, see the example converter program.

fpreadjpeg, which is using fpimage, is an example for loading a jpeg
using jpeglib.
And this in turn is used by the LCL.
So, a short LCL example loading and showing a jpeg using jpeglib is:

Put a TImage onto the form and add to FormCreate:

  Image1.Picture.LoadFromFile('example.jpg');


Mattias




More information about the Lazarus mailing list