Original Post
Hello. This section of code... ... creates this error output: I think this is an easy one, but I don't know much about casting! If anybody knows of any good resources that will stop me posting more newb questions like this one I am open to suggestions! Thanks in advance. Kind regards. Mark Coleman EDIT: My apologies about the formatting, I have tried to reduce the width of the source windows, but I have had no luck. ;(
// Loop through the bits and premultiply the values
for (int y=0;y<db.dsBm.bmHeight;++y)
{
BYTE *pPixel = db.dsBm.bmBits + db.dsBm.bmWidth * 4 * y;
for (int x=0;x<db.dsBm.bmWidth;++x)
{
pPixel[0]= pPixel[0]*pPixel[3]/255;
pPixel[1]= pPixel[1]*pPixel[3]/255;
pPixel[2]= pPixel[2]*pPixel[3]/255;
pPixel+= 4;
}
}
// Where db is defined earlier like this
DIBSECTION db;
GetObject(hBmp, sizeof(db), &db);
C:\Documents and Settings\Mark\StarChart\Testing\Non-Unicode Particle Test\Screen.cpp(1025) : error C2036: 'void *' : unknown size
C:\Documents and Settings\Mark\StarChart\Testing\Non-Unicode Particle Test\Screen.cpp(1025) : error C2440: 'initializing' : cannot convert from 'unsigned char' to 'unsigned char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast