Converting Buffer image to DC
-
Hi, I have a framegrabber that snaps an image and sends it to a memory buffer at m_pBuffer (type of LPVOID). I do not know the content structure of the m_pBuffer, but i know i contains a 24bit RGB Bitmap. Doing the operation below (SetDIBitsToDevice), allows me to plot the contents to the screen. I want to transfer the contents of m_pBuffer to my own device context (CDC myDC), so that i can use GetBitmapBits and manipulate the date prior to plotting on to the screen. Can anyway point me on how to do this? Do i use SetDIBits, if so, how? CClientDC dc(this); if ( m_pBuffer == NULL ) return ; pBitmapInfoRGB24->bmiHeader.biWidth = ImageSizeX ; pBitmapInfoRGB24->bmiHeader.biHeight = - ImageSizeY; // ------------------------------------------------------------------------ // Transfer the image to display // ------------------------------------------------------------------------ SetDIBitsToDevice ( dc.GetSafeHdc(), 22, 25 , ImageSizeX, ImageSizeY , 0, 0, 0, ImageSizeY , &m_pBuffer , pBitmapInfoRGB24 , DIB_RGB_COLORS); bOnGoingRefresh = false ;