Mail Archives: djgpp/1997/03/14/10:14:22
On Tue, 11 Mar 1997, Shawn Hargreaves wrote:
> Michal Mertl writes:
> >I tried to export the screen into both BMP and TGA files following the
> >example in allegro.doc for saving palette, but it seems that resulting
> >image has still different palette (blue is not blue..).
>
> Can you post an example of the code you are using to do this?
>
Here it is.
#include "allegro.h"
int main()
{
PALETTE pal;
BITMAP *bmp;
char *buf="test.bmp";
int i;
allegro_init();
install_keyboard();
i=set_gfx_mode(GFX_AUTODETECT,800,600,0,0);
if (i<0) {
allegro_exit();
printf("Graphics initialization error: %s\n",allegro_error[i]);
return(1);
}
bmp=create_sub_bitmap(screen,0,0,800,600);
for (i=0;i<16;i++) rectfill(screen,i*30,0,(i+1)*30,100,i);
get_palette(pal);
save_bitmap(buf, bmp, pal);
readkey();
return(0);
}
It seems like there is a bit more blue than red and green, cause white is
very light blue and others also seems affected.
///\ /\\\ || ///\ /\\\ Michal Mertl
/// \/ \\\ /// \/ \\\ /---\ MiMe AT EUnet DOT cz
/// \\\ || /// \\\ |---'
/// \\\ || /// \\\ \---/
- Raw text -