trying to copy a bitmap into the WMP Renderer -> upside down!

Posted by Roey on Stack Overflow See other posts from Stack Overflow or by Roey
Published on 2010-04-27T15:21:01Z Indexed on 2010/04/27 15:23 UTC
Read the original article Hit count: 256

Filed under:
|
|
|

Hi All. I'm writing a video DMO decoder and trying to return a bitmap to the WMP renderer for display ... but WMP displays it upside down!

This is the code :

HBITMAP*  hBmp = new HBITMAP();

int result;

m_pScrRenderer->CreateFrame(hBmp, &result);  ///This returns the HBITMAP handle.

BITMAP bmStruct;

memset(&bmStruct, 0, sizeof(BITMAP));

GetObject(*hBmp, sizeof(BITMAP), &bmStruct);  
int size = bmStruct.bmWidthBytes * bmStruct.bmHeight;
memcpy(pbOutData, bmStruct.bmBits, size); //PBoutData is WMP's renderer buffer.

This produces an upside down image. What should I change in this code?

Thank You!

Roey.

© Stack Overflow or respective owner

Related posts about wmp

Related posts about c++