• Advertisement
Sign in to follow this  

Vmr9 alpha blending doesn't work at certain sizes for .rSrc

This topic is 4586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The VMR9 alpha bitmap does not blend properly, eliminating the scrcolor, when the size of the bitmap is at certain settings. I have done some testing. A size of 0,0,128,32 works but 0,0,600,600 does not eliminate the scrcolor pixels. Does anyone know the cause of this and can provide a solution? I am using directx sdk 9.0c. A sample of the code is given below // Configure the VMR's bitmap structure ZeroMemory(&gCap.pVMR9AlphaBmp, sizeof(gCap.pVMR9AlphaBmp)); gCap.pVMR9AlphaBmp.dwFlags = VMR9AlphaBitmap_hDC|VMR9AlphaBitmap_SrcColorKey; gCap.pVMR9AlphaBmp.hdc = hdcBmp1; RECT rc; //Set the source rect SetRect(&rc, 0, 0, 320, 128); //Alpha blending doesn't work properly //this values are changed gCap.pVMR9AlphaBmp.rSrc = rc; //rDest specifies the destination rectangle in composition space (0.0f to 1.0f) gCap.pVMR9AlphaBmp.rDest.left = 0.0f;//g_xPos; //default gCap.pVMR9AlphaBmp.rDest.top = 0.0f;//g_yPos; gCap.pVMR9AlphaBmp.rDest.right = 1.0f;//g_xPos + g_xSize; gCap.pVMR9AlphaBmp.rDest.bottom = 1.0f;//g_yPos + g_ySize; // Set the COLORREF so that the bitmap outline will be transparent gCap.pVMR9AlphaBmp.clrSrcKey = RGB(255, 255, 255); //default gCap.pVMR9AlphaBmp.dwFlags |= VMR9AlphaBitmap_SrcColorKey ;//|VMR9AlphaBitmap_Disable; // Transparency value 1.0 is opaque, 0.0 is transparent. gCap.pVMR9AlphaBmp.fAlpha = 1; //default //Get VMR9 alpha-blended bitmap interface HRESULT hres = gCap.pVMRWC9->QueryInterface(IID_IVMRMixerBitmap9, (void**)&gCap.pVMRMixerBmp9); //HRESULT hres = m_Wc->QueryInterface(IID_IVMRMixerBitmap9, (LPVOID *)&pBmp); if(SUCCEEDED(hres)) { hres = gCap.pVMRMixerBmp9->SetAlphaBitmap(&gCap.pVMR9AlphaBmp); //pBmp->Release(); }

Share this post


Link to post
Share on other sites
Advertisement
Hi to all those who have used vmr9 alpha blending/ vmr9alphabitmap please help.. thx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement