Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is RGBQUAD bmiColors[1] parameter in BITMAPINFO structure

428 views
Skip to first unread message

Graham Pratt

unread,
Mar 29, 2000, 3:00:00 AM3/29/00
to
The BITMAPINFO structure is prototyped as follows:

typedef struct tagBITMAPINFO { // bmi
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[1];
} BITMAPINFO;


When I try to initialize the bmiColors[1] parameter like so:

BITMAPINFO blah;

blah.bmiColors = pRGB; //pRGB is a pointer to a 256-element
//array of RGBQUADs

I get the following error:

"cannot convert from 'struct tagRGBQUAD *' to 'struct tagRGBQUAD [1]'"

I must be missing something really basic here. What's an RGBQUAD[1]?

What should I be feeding the bmiColors as an argument?

Any help appreciated.

Thanks.

Graham Pratt
(jpr...@po-box.mcgill.ca)


ivan...@my-deja.com

unread,
Mar 29, 2000, 3:00:00 AM3/29/00
to
as follows

BITMAPINFO *bm;
bm = new char[ sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) *
cant_colors ];
RGBQUAD * ptr = bm->bmiColors[0];

ptr points to the first color in the palette entry
++ptr to the second

In article <38e15f4c...@news1.qc.sympatico.ca>,


Sent via Deja.com http://www.deja.com/
Before you buy.

0 new messages