x,y are you co-ordinates
((BYTE *) ddsd.lpSurface)[y * ddsd.lPitch + x]
((BYTE *) ddsd.lpSurface)[y * ddsd.lPitch + x]
I know that there has to be a way to determine the color of a pixel in 256 color mode, I'm just not sure what is is :-).
Can anyone help?
Thanks.
code:UCHAR* buffer;DDSURFACEDESC2 ddsd;UCHAR TheEntry;PALETTEENTRY entry;int r, g, b;ZeroMemory(&ddsd, sizeof(ddsd));ddsd.dwSize = sizeof(ddsd);lpDDSWhatever->Lock(NULL, &ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL);buffer = (UCHAR*)ddsd.lpSurface;TheEntry = buffer[x+(y*ddsd.lPitch)];lpDDSWhatever->Unlock(NULL);lpDDSWhatever->GetEntries(0, 0, 1, &entry[TheEntry]);r = entry.peRed;g = entry.peGreen;b = entry.peBlue;
This should work, I hope.
CU
------------------
Skullpture Entertainment
#40842461
[This message has been edited by NuFAN (edited October 24, 1999).]