I want to draw image(bmp) using an image pointer by VS2005(MFC).
But I don’t know how to draw an image using image pointer.
Below is my code:
PVOID m_pBuffer;
m_pBuffer = lBuffer->GetDataPointer(); //lBuffer is offered parameter by Camera Company.
//and GetDataPointer() funcion is 'A pointer to the memory pointer'
How do I draw an image using image pointer?
(ex. use GDI, GDI+, CImage..)
Depending what you want to do with it have a look at both CreateBitmap and CreateDIBSection.
To use CreateBitmap
lpBitsis where you pass in yourm_pBuffer. Make sure the bitmap is the same format as your data!For a 24bit BMP at 800×600: