Advertisement Jump to content
Sign in to follow this  
Programmer101

Getting a bitmap from DirectShow

This topic is 3994 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

I have a program that plays a video with the direct show VMR9 windowless control. I'm trying to get each frame as it plays so that I can sample the pixels for movement. The windowless control has a method for getting the current image:
HRESULT GetCurrentImage(
  BYTE**  lpDib
);
I want to use this method, but I'm not sure exactly how to use the data that the method provides. MSDN gives a start for how to do this:
BYTE *lpDib = NULL;
hr = pWindowlessControl->GetCurrentImage(&lpDib);
if (SUCCEEDED(hr))
{
    BITMAPINFOHEADER *pBMIH = (BITMAPINFOHEADER*)lpDib;
    /* .... */
    CoTaskMemFree(lpDib);
}
and thats nice but... it doesn't explain how to get the actual pixel data from the bitmap. I've tried looking at other documentation but there don't seem to be any good examples for this. How can I get the pixel data from this bitmap?

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!