delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/13/17:41:44

Date: Tue, 13 Oct 1998 22:40:04 +0100 (BST)
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: using a bitmap's palette
In-Reply-To: <6vu5jd$m2k$1@news.us.world.net>
Message-ID: <Pine.OSF.4.05.9810132237040.12073-100000@sable.ox.ac.uk>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Mon, 12 Oct 1998, Aaron wrote:

>     How can I set the palette in Allegro to use the palette from a 256 color
> Windows bitmap file?

    BITMAP *bitmap;
    PALETTE the_palette;
    ...
    bitmap = load_bitmap ("file.bmp", the_palette);
    set_palette (the_palette);

Look up `set_palette' and `load_bitmap' in the documentation for
more information.  Note that you really ought to check that
`load_bitmap' does not return NULL -- I left this out for
brevity.  In addition, special things need to be considered if
you're loading a bitmap of a different colour depth to the
screen.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

xu do tavla fo la lojban  --  http://xiron.pc.helsinki.fi/lojban/lojban.html

- Raw text -


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