delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/11/05:40:55

From: "Pavlos" <trash24379 AT usa DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: BMP file : how to load and set the palette WHITOUT using any library
Date: Sun, 11 Jul 1999 04:10:25 +0300
Organization: An OTEnet S.A. customer
Lines: 18
Message-ID: <7m8qsv$dc6$1@newssrv.otenet.gr>
References: <37866EC2 DOT D137FDC4 AT club-internet DOT fr>
NNTP-Posting-Host: dram-a02.otenet.gr
X-Trace: newssrv.otenet.gr 931655391 13702 195.167.113.225 (11 Jul 1999 01:09:51 GMT)
X-Complaints-To: abuse AT otenet DOT gr
NNTP-Posting-Date: 11 Jul 1999 01:09:51 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

>I know how to load a BMP file  but no the palette, so it's ugly...
>if someone could mail me a DJGPP source...it would help me a lot.
>
I don't have any source to send you (except Allegro's sources) so here's a
tip:

For palette BMP files, the palette follows the header of the file. For 8 bit
files, the palette's size is 1024 bytes.
Each 4 byte set represents one palette entry (R, G, B, 0). The 4th byte is
always 0, ignore it. Also note that
the values stored in the palette of a BMP file are 0-255, not 0-63, so you
have to convert them yourself before setting the palette.

I think this is how I did it a long time ago. I hope I remember it ok.
Pavlos



- Raw text -


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