//Capture bitmap form directshow by IVMRWindowlessControl9 interface
int destHeight, LPCWSTR fileName)
   3: {
   4:     BYTE* pDib = NULL;
   5:     HRESULT hr = pVMRControl9->GetCurrentImage(&pDib);
if (FAILED(hr))
return hr;
   8:  
   9:     BITMAPINFO* pBitmapInfo = (BITMAPINFO*)pDib;
  10:     HDC hScreenDC = ::GetDC(NULL);
  11:     ASSERT(hScreenDC != NULL);
sizeof(BITMAPINFOHEADER);
  13:     HBITMAP hBitmap = ::CreateDIBitmap(hScreenDC,&(pBitmapInfo->bmiHeader),CBM_INIT,pBits,pBitmapInfo,DIB_RGB_COLORS);
//
//Do something with hBitmap here
//
  17:     ::DeleteObject(hBitmap);
  18:     ::ReleaseDC(NULL,hScreenDC);
  19:     ::CoTaskMemFree(pDib);
  20:  
return hr;
  22: }

相关文章:

  • 2021-10-20
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案