If dbCreateImageFromMemblock worked, you could pack all your images in a file full of memblocks and load them as a single file into your game. You could even do some encryption on the memblocks to keep it more secure. This file will be larger than all the images together because memblocked images are as bitmaps. If you knew some way to compress data like a zip, this would minimize the file size....
Even without dbCreateImageFromMemblock, you could save all your images the way I described and load them one at a time, sending the data to a bitmap and then capturing the image. This is a little time consuming, but not too bad if you don't have huge images or a bunch of them.
This is my method for making a bump image from a source image:
int MakeBumpImage(int Image){
int iWidth=dbImageWidth(Image);
int iHeight=dbImageHeight(Image);
int MB=dbCreateMemblockFromImage(Image);
dbLockPixels ( );
char *p = (char*)dbGetPixelsPointer();
for (int H=0;H<iHeight;H++){
for (int W=0;W<iWidth;W++){
DWORD C;
if (W>0) C=dbMemblockDword(MB,(H*iWidth+W-1)*4+12);
else C=dbMemblockDword(MB,(H*iWidth+iWidth-1)*4+12);
byte R=dbRGBB(C);
if (W<iWidth-1) C=dbMemblockDword(MB,(H*iWidth+W+1)*4+12);
else C=dbMemblockDword(MB,(H*iWidth+0)*4+12);
R=(R-dbRGBB(C)+255)/2;
if (H>0) C=dbMemblockDword(MB,((H-1)*iWidth+W)*4+12);
else C=dbMemblockDword(MB,((iHeight-1)*iWidth+W)*4+12);
byte G=dbRGBB(C);
if (H<iHeight-1) C=dbMemblockDword(MB,((H+1)*iWidth+W)*4+12);
else C=dbMemblockDword(MB,(W)*4+12);
G=(G-dbRGBB(C)+255)/2;
*(p+((H*ScreenW+W)*4+0))=byte(255);//blue
*(p+((H*ScreenW+W)*4+1))=byte(G);
*(p+((H*ScreenW+W)*4+2))=byte(R);
}
}
dbUnlockPixels ( );
int B=dbGetImage(0,0,iWidth,iHeight);
dbDeleteMemblock(MB);
return B;
}
This procedure requires an image already exists. You should be able to modify it to simply take what's in the memblock and put it on the bitmap. And at the end, return the image number.
You will have to make sure you have a good bitmap created first:
int bitmap=dbCreateBitmap(ScreenW,ScreenH);
dbSetCurrentBitmap (bitmap);
// load each memblock and call the function
dbDeleteBitmap(bitmap);
The fastest code is the code never written.