That problem was solved by yours truly some time ago.
Feel free to swipe it and convert it:
#include <DarkSDK.h>
#include "resource.h"
#pragma warning( disable : 4244 )
#define BITMAPNUM 1
#define MEMBLOCKNUM 1
void DarkSDK(void)
{
HBITMAP hMiniBitmap = LoadBitmap(GetModuleHandle(0), MAKEINTRESOURCE(IDB_BITMAP1));
if (hMiniBitmap)
{
// Get the size of the bitmap
BITMAP bitmap;
::GetObject(hMiniBitmap, sizeof(BITMAP),&bitmap);
int size = bitmap.bmHeight*bitmap.bmWidth*bitmap.bmBitsPixel/8;
// Get the bitmap data from the resource
BYTE *lpBits = new BYTE[ size ];
::GetBitmapBits(hMiniBitmap, size, lpBits);
// Copy the bitmap datato a memory block
dbMakeMemblock(MEMBLOCKNUM, size + 12);
for (int i=0; i<size; i++)
dbWriteMemblockByte(MEMBLOCKNUM, i+12, lpBits[i]);
dbWriteMemblockDWORD(MEMBLOCKNUM, 0, bitmap.bmWidth);
dbWriteMemblockDWORD(MEMBLOCKNUM, 4, bitmap.bmHeight);
dbWriteMemblockDWORD(MEMBLOCKNUM, 8, bitmap.bmBitsPixel);
// Cleanup
delete []lpBits;
dbMakeBitmapFromMemblock(BITMAPNUM, MEMBLOCKNUM);
if (dbBitmapExist(BITMAPNUM) == 1)
{
dbCopyBitmap(BITMAPNUM, 0);
}
}
while (dbScanCode() == 0)
dbSync();
}
It might be better to create an image and populate the DX texture directly - that was the step I never bothered to get to, but it should be easy enough, even if you need to convert to a different bit depth.