Page 1 of 1

gflLoadThumbnail > background color?

Posted: Thu Jun 24, 2010 9:02 am
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?

Re: gflLoadThumbnail > background color?

Posted: Fri Jun 25, 2010 9:49 am
by xnview
You can use GFL_LOAD_PREVIEW_NO_CANVAS_RESIZE and make your own CanvasResize...

Re: gflLoadThumbnail > background color?

Posted: Mon Jun 28, 2010 5:41 am
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?

Re: gflLoadThumbnail > background color?

Posted: Tue Jun 29, 2010 9:09 am
by xnview
Ok, a bug!