2012-10-11 132 views
1

我想通過VS2005(MFC)使用圖像指針繪製圖像(bmp)。使用圖像指針繪製圖像

但我不知道如何使用image pointer來繪製圖像。

下面是我的代碼:

PVOID m_pBuffer; 
m_pBuffer = lBuffer->GetDataPointer(); //lBuffer is offered parameter by Camera Company. 
             //and GetDataPointer() funcion is 'A pointer to the memory pointer' 

如何畫使用image pointer的形象呢? (例如,使用GDIGDI+CImage ..)

+0

我試圖GDI,GDI +,的CImage,HBITMAP,位... 但是所有條件失敗。 – user1736556

回答

1

取決於你想用它做什麼看看這兩個CreateBitmapCreateDIBSection

使用CreateBitmaplpBits是您通過m_pBuffer的地方。確保位圖與您的數據格式相同!

對於24位BMP爲800x600:

HBITMAP MyBmp = CreateBitmap(800, 600, 1, 24, m_pBuffer);