当前位置: 代码迷 >> VC/MFC >> DDB如何转DIB
  详细解决方案

DDB如何转DIB

热度:168   发布时间:2016-05-02 03:48:09.0
DDB怎么转DIB
写了一个截图程序,截图功能已经写好,现在的问题是截完图后只有一个位图句柄hBitmap,怎么转成DIB然后保存到剪切板?用的是win32 sdk
------解决思路----------------------
LONG GetBitmapBits(  HBITMAP hbmp,      // handle to bitmap
  LONG cbBuffer,     // number of bytes to copy
  LPVOID lpvBits     // buffer to receive bits);

+
HBITMAP CreateBitmap(  int nWidth,         // bitmap width, in pixels
  int nHeight,        // bitmap height, in pixels
  UINT cPlanes,       // number of color planes
  UINT cBitsPerPel,   // number of bits to identify color
  CONST VOID *lpvBits // color data array);
  相关解决方案