From: Walter Luke Newsgroups: comp.os.msdos.djgpp Subject: Allegro, Bitmaps, and Palettes Date: Fri, 02 Jan 1998 04:03:09 -0500 Organization: http://shadows.sacrilege.com Lines: 28 Message-ID: <68iaj1$f64@bgtnsc03.worldnet.att.net> Reply-To: NightWatchman AT Sacrilege DOT com NNTP-Posting-Host: 12.68.12.188 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I'm experimenting with reading 256 color bitmaps from disk and displaying them on the screen using Allegro. The problem is that the colors come out wrong, which I assume could only be because the palette is wrong. If this is true, then allegro must not automatically set the palette to whatever is appropriate for that image, which kind of surprises me...But anyway... I would greatly appreciate it if someone could fill me in on how to set the correct palette for a given bitmap (e.g. how to create a variable of type PALETTE from the bitmap). Just to make sure my problem isn't something completely different, I'm including the source code below. I get the same result when I use a datafile. #include BITMAP *thing; PALETTE pte; main () { set_gfx_mode(GFX_AUTODETECT, 800, 600, 0, 0); thing = load_bmp("rose.bmp", pte); blit(thing, screen, 1, 1, 1, 1, 100, 100); }