www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/25/09:45:46

From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro----Finding dimensions of .pcx's
Date: 25 Feb 1997 05:02:55 GMT
Organization: The National Capital FreeNet
Lines: 26
Message-ID: <5etrpv$606@freenet-news.carleton.ca>
References: <kmQgUUALQYEzEwS2 AT jenkinsdavid DOT demon DOT co DOT uk>
Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
NNTP-Posting-Host: freenet5.carleton.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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