DELPHI - working GFL-SDK demo

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

Mariusz
Posts: 2
Joined: Wed Feb 21, 2007 11:00 am

DELPHI - working GFL-SDK demo

Post by Mariusz »

Hi,

I've downloaded gflSDK library to try to use it in delphi.
There is an attached delphi demo program but it doesn't work with JPEG2000 - which needs Xjp2.dll.
What should I do ?
Will it work at all ?

Thanks,

Mariusz.
User avatar
xnview
Author of XnView
Posts: 44470
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: DELPHI - working GFL-SDK demo

Post by xnview »

Mariusz wrote:Hi,

I've downloaded gflSDK library to try to use it in delphi.
There is an attached delphi demo program but it doesn't work with JPEG2000 - which needs Xjp2.dll.
What should I do ?
Will it work at all ?
You must use gflSetPluginsPathname before gflLibraryInit
Pierre.
Mariusz
Posts: 2
Joined: Wed Feb 21, 2007 11:00 am

Post by Mariusz »

I've copied xjp2.dll into c:\windows\system32 and modified source delphi demo program.
This is the delphi code - it doesn't work anyway
begin
gflSetPluginsPathname('c:\windows\system32\');
gflLibraryInit();
gflGetDefaultLoadParams(lp);
lp.FormatIndex:=-1;
lp.ColorModel := GFL_RGB;
lp.LinePadding := 4;
if OpenDialog.Execute then
begin
e := gflLoadBitmap( pchar(OpenDialog.FileName), gfl_bmp, lp, finfo );
bitmap:=TBitmap.Create;
bitmap.width:=gfl_bmp.Width;
bitmap.height:=gfl_bmp.Height;
for y := 0 to gfl_bmp.Height - 1 do begin
move( Pointer(Integer(gfl_bmp.data) + (y * gfl_bmp.BytesPerLine))^,
bitmap.Scanline[y]^, gfl_bmp.BytesPerLine);
end;
Image.Picture.Bitmap:=bitmap;
gflFreeBitmap(gfl_bmp);
bitmap.free;
end;
gflLibraryExit();
end;