picture preview

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

picture preview

Marc Santhoff-2
Hi,

if I want load a bitmap picture for extracting a small preview of it,
what component or library would be best?

My goal is to use pascal only without any external lirbraries if
possible. Second goal is to keep the program small, ideally avoiding to
link lcl controls in.

Bitmap picture may be anything commen, JPEG, PNG, GIF, BMP, etc.

TIA,
Marc


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: picture preview

leledumbo
Administrator
> if I want load a bitmap picture for extracting a small preview of it,
> what component or library would be best?

fcl-image (http://wiki.freepascal.org/fcl-image) is the basis of LCL image processing components and routines, so you can for sure use that. I use it to resize uploaded pictures in one of my web applications. TFPImageCanvas (TFPCustomCanvas to be precise) implements CopyRect which you can use for cropping. The wiki article (and the package directory) has some examples to start with.
Reply | Threaded
Open this post in threaded view
|

Re: picture preview

Andrew Haines
In reply to this post by Marc Santhoff-2
On 11/08/2016 01:51 PM, Marc Santhoff wrote:

> Hi,
>
> if I want load a bitmap picture for extracting a small preview of it,
> what component or library would be best?
>
> My goal is to use pascal only without any external lirbraries if
> possible. Second goal is to keep the program small, ideally avoiding to
> link lcl controls in.
>
> Bitmap picture may be anything commen, JPEG, PNG, GIF, BMP, etc.
>
> TIA,
> Marc

Hi I attached a small program I just wrote that resizes an image and
saves it to a file. I didn't test it but it compiles. It uses just the
png reader/writer components but there are several units for different
image formats.

FPReadPNG, FPWritePNG
FPReadBMP, FPWriteBMP etc.

Regards,

Andrew Haines

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

imageresize.lpr (1K) Download Attachment