Mail Archives: djgpp/1997/04/01/10:48:38
In article <01bc39ad$32477300$90081ecb AT sly>, "Sly" <sly AT aussie DOT net> writes:
+->Thomas Harte <T DOT Harte AT btinternet DOT com> wrote in article
+-><01bc36a8$c77e9aa0$522549c2 AT default>...
+->> How do you find out the size of an Allegro bitmap?
+->> I read the Allegro.txt, and it told me about the bitmap struct, but
+->> <bitmap>.h & <bitmap>.w don't work. What is the correct way to read the
+->> dimensions of an Allegro bitmap?
+->
+->A bitmap is declared by the following line:
+->
+->BITMAP *bitmap;
+->
+->This is a pointer to the bitmap. To get access to the members of this
+->structure, use the -> operator, as such...
+->
+->size = bitmap->w * bitmap->h;
+->
Yes, you can also do it this way:
size = (*bitmap).w * (*bitmap).h;
I prefer using the one with " -> " but you can find the other too.
--
Fred.
Frederic Triquet
E-Mail: triquet AT fil DOT univ-lille1 DOT fr
Or: rodger DOT adrenaline AT writeme DOT com
- Raw text -