int dataSize = (width * height * (unsigned int)(bmih.biBitCount / 8.0));
//calculate the number of available colours
int numColours = 1 << bmih.biBitCount;
colours = new RGBQUAD[numColours];
fread(colours, sizeof(RGBQUAD), numColours, bitmap);
data = new char[dataSize];
//Return false if there is not enough memory.
if (NULL == data)
{
fclose(bitmap);
return false;
}
fread(data, sizeof(char), dataSize, bitmap);
fclose(bitmap);
However, I'm still a bit in the dark about how to loop through the pixels utilising x and y positions and retrieving their colours.
This post has been edited by Aequitas1: 03 June 2012 - 04:39 PM

New Topic/Question
Reply




MultiQuote





|