Fill Colors on Linux

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

Moderators: helmut, XnTriq, xnview

tailormade

Fill Colors on Linux

Post by tailormade »

I am using the following code to set the image background to white:

error = bitmap.Allocate(GFL_RGB, Width, Height);
bitmap.SetFillColor(GFLW_COLOR(255,255,255));
bitmap.DrawFillRectangle(0, 0, Width, Height);

It works fine on Windows, but produces a purple background on Linux. Any ideas?
User avatar
xnview
Author of XnView
Posts: 45870
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Fill Colors on Linux

Post by xnview »

tailormade wrote:I am using the following code to set the image background to white:

error = bitmap.Allocate(GFL_RGB, Width, Height);
bitmap.SetFillColor(GFLW_COLOR(255,255,255));
bitmap.DrawFillRectangle(0, 0, Width, Height);

It works fine on Windows, but produces a purple background on Linux. Any ideas?
And could you post the code used to save picture?
Pierre.
tailormade

Save Routines

Post by tailormade »

Sure, here is the code I use to save a GIF file (I removed the code for other formats).

GFL_ERROR error;
GFLW_SAVE_PARAMS save_option;
GFLW_FORMAT format;
char ext[5];

strcpy(ext,"gif");
save_option.SetFormat(ext);

bitmap.ChangeColorDepth(GFL_MODE_TO_256COLORS, GFL_MODE_ADAPTIVE);
error = bitmap.SaveIntoFile( OutputFile, save_option );
User avatar
xnview
Author of XnView
Posts: 45870
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Save Routines

Post by xnview »

tailormade wrote:Sure, here is the code I use to save a GIF file (I removed the code for other formats).

GFL_ERROR error;
GFLW_SAVE_PARAMS save_option;
GFLW_FORMAT format;
char ext[5];

strcpy(ext,"gif");
save_option.SetFormat(ext);

bitmap.ChangeColorDepth(GFL_MODE_TO_256COLORS, GFL_MODE_ADAPTIVE);
error = bitmap.SaveIntoFile( OutputFile, save_option );
Could you send me a PM with your email to send a version?
Pierre.
tailormade
Posts: 15
Joined: Fri Jun 24, 2005 6:08 pm

PM

Post by tailormade »

I have done so. I look forward to the new version.

Scott