delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/24/08:39:58

Message-ID: <F77915E7F086D31197F4009027CC81C9219BE4@probe-2.as-london.acclaim.com>
From: Shawn Hargreaves <SHargreaves AT acclaimstudios DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Size of Loaded Bitmaps in Allegro
Date: Mon, 24 Jan 2000 12:16:55 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Reply-To: djgpp AT delorie DOT com

Darac writes:
> Now, from what I can tell from the Allegro Docs, load_bitmap will
> create the in_jpeg bitmap and load the JPG into it. However, how
> can I get the width and height of that bitmap.

For a BITMAP *bmp, bmp->w is the width, and bmp->h is the height.

> Also, I'm assuming that the in_jpeg bitmap will be 24bit (or
> whatever) but do I _have_ to go into graphics mode first.

No. Otherwise how would things like the dat utility work?

But, you do need to check how your set_color_conversion() flags are
set. If you've enabled a mode that requires conversion during the
load, make sure you've set_color_depth() to the format you want to
be loaded, and if you are reading into an 8 bit image, make sure
you've set_palette() or select_palette() to indicate which palette
the color reduction should use.

And be aware that if you load graphics while in text mode, you cannot
later set a graphics mode and display these images, as they may have
been stored in a different format to what your graphics card is using
(because if you don't set a graphics mode yet, Allegro has no way to
know what format the card will use). Text mode programs can do 
whatever they like as long as they just read, modify, and then write
out images, but if you ever want to draw to the screen, you must set
the video mode before creating or reading any images.


	Shawn Hargreaves.

- Raw text -


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