delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/08/10:56:31

From: ian_dunbar AT hotmail DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ALLEGRO: problem with bitmap palette from datafile
Date: Mon, 08 Mar 1999 15:38:12 GMT
Organization: Deja News - The Leader in Internet Discussion
Lines: 28
Message-ID: <7c0qt3$6ld$1@nnrp1.dejanews.com>
References: <8D53104ECD0CD211AF4000A0C9D60AE360F7CA AT probe-2 DOT acclaim-euro DOT net>
NNTP-Posting-Host: 193.120.210.2
X-Article-Creation-Date: Mon Mar 08 15:38:12 1999 GMT
X-Http-User-Agent: Mozilla/4.05 [en] (WinNT; I)
X-Http-Proxy: 1.0 ns.euristix.ie:80 (Squid/1.NOVM.20), 1.0 x7.dejanews.com:80 (Squid/1.1.22) for client unknown, 193.120.210.2
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <8D53104ECD0CD211AF4000A0C9D60AE360F7CA AT probe-2 DOT acclaim-euro DOT net>,
  djgpp AT delorie DOT com wrote:
> ian_dunbar AT my-dejanews DOT com writes:
> > I have a problem displaying a 256 color bitmap. It is displayed as all the
> > wrong colors.
>
> Your code looks ok, so I'd guess that this is a color format conversion
> problem. What color depth are you using, and what format is your image?
> Are you sure that you are setting the graphics mode before you load
> in the file? If you are loading a paletted graphic for display in
> a truecolor mode, you'll need to disable the automatic color conversion
> and do this yourself before you display it: see the set_color_conversion()
> function in the docs.
>
> 	Shawn Hargreaves.

It was a color conversion problem. The bitmap was an 8bpp RGB encoded windows
bitmap, and I was just displaying in VGA 320x200x8bpp, so I didn't think that
there would have been any conversion happening, but the dat utility doesn't
seem to store the bitmap at the same bpp as the .bmp file (does it have a
default depth or something?). I added a "-bpp 8" switch to the commands to
store the bitmap & palette and it works fine.

Thanks,
Ian.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

- Raw text -


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