bi.bisizeimage = (bi.bisizeimage * 3) / 2;
}
//重新分配内存大小,以便放下所有数据
dwlen += bi.bisizeimage;
handle = globalrealloc(hdib, dwlen, gmem_moveable) ;
if (handle != null)
hdib = handle;
else
{
globalfree(hdib);
//重选原始调色板
selectpalette(hdc,hpal,false);
::releasedc(null,hdc);
return null;
}
//获取位图数据
lpbi = (lpbitmapinfoheader)hdib;
//最终获得的dib
bool bgotbits = getdibits( hdc, (hbitmap)bitmap.getsafehandle(),
0l, //扫描行起始处
(dword)bi.biheight, //扫描行数
(lpbyte)lpbi //位图数据地址
+ (bi.bisize + ncolors * sizeof(rgbquad)),