ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/14/10:14:22

From: Michal Mertl <mime AT eunet DOT cz>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problem with Allegro
Date: Fri, 14 Mar 1997 12:07:31 +0100
Organization: a Customer of EUnet Czechia
Lines: 44
Message-ID: <Pine.BSI.3.96.970314115651.27298A-100000@prg.traveller.cz>
References: <Pine DOT BSI DOT 3 DOT 96 DOT 970310184517 DOT 22850A-100000 AT prg DOT traveller DOT cz> <I0RB6HAXVaJzEw+l AT talula DOT demon DOT co DOT uk>
NNTP-Posting-Host: prg.traveller.cz
Mime-Version: 1.0
In-Reply-To: <I0RB6HAXVaJzEw+l@talula.demon.co.uk>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019