This function loads the image into a bitmap. Do not release the surface, as a bitmap consists of a surface only.
void loadBitmap(int iID, LPCTSTR pSrcResource)
{
int bmpCurrent;
D3DXIMAGE_INFO pSrcInfo;
LPDIRECT3DSURFACE9 ppSurfaceLevel;
bmpCurrent = dbCurrentBitmap();
D3DXGetImageInfoFromResource(NULL, pSrcResource, &pSrcInfo);
dbCreateBitmap(iID, pSrcInfo.Width, pSrcInfo.Height);
ppSurfaceLevel = g_pGlob->pCurrentBitmapSurface;
D3DXLoadSurfaceFromResource(ppSurfaceLevel, NULL, NULL, NULL, pSrcResource, NULL, D3DX_FILTER_POINT, NULL, &pSrcInfo);
dbSetCurrentBitmap(bmpCurrent);
}