gflLoadThumbnail > background color?

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

Moderators: XnTriq, xnview

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

gflLoadThumbnail > background color?

Post by AmigoJack » Thu Jun 24, 2010 9:02 am

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: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: gflLoadThumbnail > background color?

Post by xnview » Fri Jun 25, 2010 9:49 am

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

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 1152 times
tomcat.gif
tomcat.gif (1.89 KiB) Viewed 1152 times

User avatar
xnview
Author of XnView
Posts: 31607
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: gflLoadThumbnail > background color?

Post by xnview » Tue Jun 29, 2010 9:09 am

Ok, a bug!
Pierre.

Post Reply