delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/09/17:18:12

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Saving BITMAP in allegro
Date: Tue, 9 Dec 1997 19:26:46 +0000
Organization: None
Distribution: world
Message-ID: <8sTMfHA2tZj0EwFl@talula.demon.co.uk>
References: <66f3uo$j1r$1 AT walton DOT videotron DOT net>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 23
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Jean-Sebastien Payette writes:
>How do I save a (allegro) bitmap to a file in a raw format???

However you like! Write out whatever header information you need,
followed by all the pixels from the image. To load it back in, read your
header, call create_bitmap() to make an object of the required size, and
then read the pixel values back into it. Look at the Allegro .pcx and
.bmp load/save routines for an example...

[...]
>The author say that there is some other stuff in the struct but don't
>tell what??

You can look in the sources if you really need to know, but be warned
that the innards of the structure are liable to change from one version
to the next. You don't need all that crap when saving an image, though:
it is just the width, height, color depth, and pixels that are
important...


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa

- Raw text -


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