example: 005

Purpose:

Use FreeImage library to read/write image

 

OS:

windows, linux... (any C++ compiler)

 

Place:

example/005/src

 

Notice:

you must put a multi-frame GIF image named test.gif in same folder to the executable binary

this demo use FCObjMultiFrame object to load multiple page gif image, then save every page as 1.jpg, 2.jpg...

 

Usage:

Use FreeImage to read/write image file.
1)
#define PCL_3RD_LIBRARY_USE_FREEIMAGE before #include "ImageStone.h"
if you want to use FreeImage in static lib mode, please #define FREEIMAGE_LIB before #include "ImageStone.h"

2)
add under line before using FCObjImage::Load/Save
FCObjImage::SetImageHandleFactory (new FCImageHandleFactory_FreeImage) ;

3)
download FreeImage -- http://sourceforge.net/projects/freeimage
place package file in this path under ImageStone directory
lib\FreeImage\Dist\..
lib\FreeImage\Source\..

4)
Compile FreeImage
-- VC6/2003/2005 :
open FreeImage.dsw to compile (compile project FreeImage if you want to use FreeImage in DLL mode and don't define FREEIMAGE_LIB before #include "ImageStone.h", compile project FreeImageLib if you want to use FreeImage in static lib mode and must define FREEIMAGE_LIB before #include "ImageStone.h")
the example 005 has define FREEIMAGE_LIB, so compile project FreeImageLib.

Your application's run-time library must same to FreeImage, otherwise you will encounter error LNK2005
VC6: project->settings->C/C++->Code Generation->Use run-time library
VC2003/VC2005: project->properties->C/C++->Code Generation->Runtime library

now add link FreeImaged.lib/FreeImage.lib to your project, do nothing in example 005, the link file path has been setted.

-- Linux :
type make command under lib\FreeImage