S
shaoye9604
Unregistered / Unconfirmed
GUEST, unregistred user!
如何将hBitmap保存到文件,不使用Graphics单元?function GetBitmapFromDesktop: hBitmap;varDC, MemDC: HDC;Bitmap, OBitmap: HBitmap;BitmapWidth, BitmapHeight: integer;beginDC := GetDC(GetDesktopWindow);MemDC := CreateCompatibleDC(DC);BitmapWidth := GetDeviceCaps(DC, 8);BitmapHeight := GetDeviceCaps(DC, 10);Bitmap := CreateCompatibleBitmap(DC, BitmapWidth, BitmapHeight);OBitmap := SelectObject(MemDC, Bitmap);BitBlt(MemDC, 0, 0, BitmapWidth, BitmapHeight, DC, 0, 0, SRCCOPY);SelectObject(MemDC, OBitmap);DeleteDC(MemDC);ReleaseDC(GetDesktopWindow, DC);Result := Bitmap;end;位图句柄得到后如何保存到磁盘中?