Mail Archives: djgpp/1997/02/25/09:45:46
David Jenkins (me AT jenkinsdavid DOT demon DOT co DOT uk) writes:
> When I load a .pcx into a buffer,how can I find the width and height of
> this picture???
>
> I've been thinking of using getpixel() to scan across till it reads -1
> (Outside of buffer.) to get the width then the same with height.But it
> seems a bit kludy.
int width, height;
BITMAP *p;
p=load_pcx("MYBITMAP.PCX");
width=p->w;
height=p->h;
(The allegro docs don't say explicitly, but in them is a code fragment
showing some of STRUCT BITMAP and there are members w and h I thought were
probably the width and height, and they were. :))
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -