When trying to copy a bitmap to WMP Renderer & # 8594; upside down!

I am writing a DMO video decoder and am trying to get a bitmap back to WMP rendering 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 renderer buffer.

      

This creates an inverted image. What should I change in this code?

Thanks!

Roey.

+2


a source to share


2 answers


The scanned HBITMAP lines are read in reverse order, you will need to view your scan line data and undo it at the same time.



I do not know how to do that.

+1


a source


If you can change the structure parameters of the bitmap, you can give it a negative height so that the lines come out in top-to-bottom order.



+1


a source







All Articles