This could be exceedingly simple, I'm lost though.
At one point in my app I do this:
void* buffer = NULL;
hbmSurface = ::CreateDIBSection(0, pPacket->BitmapInfo(), DIB_RGB_COLORS, &buffer, NULL, 0);
At a later point in execution, I no longer have access to pPacket->BitmapInfo() in order to create a new DIBSection. But I do have access to hbmSurface.
is there a "clone" or a way for me to get the BITMAPINFO from the hbmSurface, so that I can create a new DIBSection?
EDIT: - OR -
I also have this following the creation of the DIBSection above:
// select bitmap into memory device context (memDC) so we can draw to it.
hbmOldSurface = (HBITMAP)memDC.SelectObject(hbmSurface);
My "goal" is to be able to create a new memory surface that matches memDC in dimension and bitmap info paramaters. At the point in execution that I need to do this, I have access to both the memDC and the hbmSurface, so an approach to create a duplicate is what I'm after, either way.