Mail Archives: djgpp/2000/01/24/08:39:58
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 -