gflLoadThumbnail > background color?

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

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
AmigoJack
Posts: 33
Joined: Tue Mar 09, 2010 6:40 pm
Contact:

gflLoadThumbnail > background color?

Post by AmigoJack »

When I use...

Code: Select all

  iError:= gflLoadThumbnail( 'filename.gif', 100, 100, @pBmp, @vLoadParam, vFileInfo );
...to load a picture as thumbnail I have no control on which background color is used to fill the canvas up to 100x100 pixel. It seems like pBmp^.ColorMap^.Red/Green/Red/Alpha[0] is most commonly used (noticed this because the color was not always black) and not the color indexed by pBmp^.TransparentIndex.

Is there any way to also directly give a GFL_COLOR to use for the canvas/background?
User avatar
xnview
Author of XnView
Posts: 43601
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: gflLoadThumbnail > background color?

Post by xnview »

You can use GFL_LOAD_PREVIEW_NO_CANVAS_RESIZE and make your own CanvasResize...
Pierre.
User avatar
AmigoJack
Posts: 33
Joined: Tue Mar 09, 2010 6:40 pm
Contact:

Re: gflLoadThumbnail > background color?

Post by AmigoJack »

Code: Select all

var
  vWhite: GFL_COLOR;
  iError: GFL_ERROR;
begin
  ...
  iError:= gflLoadThumbnail( 'filename.gif', 100, 100, @pBmp, @vLoadParam, vFileInfo );
  if iError<> GFL_NO_ERROR then exit;

  vWhite.Red:= 255;
  vWhite.Green:= 255;
  vWhite.Blue:= 255;
  vWhite.Alpha:= 0;
  iError:= gflResizeCanvas( pBmp^, nil, 100, 100, GFL_CANVASRESIZE_CENTER, @vWhite );
...works as intended on most pictures: the canvas is extended with a white color.

But on these two images there is still a black color used. :(
How can I avoid/replace the black color?
Attachments
tomcat.PNG
tomcat.PNG (2.97 KiB) Viewed 1483 times
tomcat.gif
tomcat.gif (1.89 KiB) Viewed 1483 times
User avatar
xnview
Author of XnView
Posts: 43601
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: gflLoadThumbnail > background color?

Post by xnview »

Ok, a bug!
Pierre.
Post Reply