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.
DELPHI - working GFL-SDK demo
Moderators: XnTriq, helmut, xnview
-
- Author of XnView
- Posts: 44470
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: DELPHI - working GFL-SDK demo
You must use gflSetPluginsPathname before gflLibraryInitMariusz 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 ?
Pierre.
-
- Posts: 2
- Joined: Wed Feb 21, 2007 11:00 am
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;
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;