I get a BITMAPINFO from a Twain source and would like to get a FIBITMAP.
How can I convert the BITMAPINFO?
I found the solution, I needed to globally lock the memory:
// ... // Transfer the image if(pDsmEntryFunc(&m_twIdentityApp, &m_twIdentityDS, DG_IMAGE, DAT_IMAGENATIVEXFER, MSG_GET, &hDib) == TWRC_XFERDONE) { BITMAPINFO *pBitmapInfo; // Get the image data pBitmapInfo = (BITMAPINFO *)GlobalLock(hDib); // Store the image if(!(bResult = pPic->CreatePictureFromBitmapInfo(pBitmapInfo))) OutputDebugMessage(m_pWstrDebugLog, L"CTwain (line %i) : FAILED -> pPic->CreatePictureFromBitmapInfo(pBitmapInfo)\n", __LINE__); // Free the resources GlobalUnlock(hDib); } else OutputDebugMessage(m_pWstrDebugLog, L"TWAIN : DAT_IMAGENATIVEXFER != TWRC_XFERDONE\n"); // ...
Log in to post a comment.
I get a BITMAPINFO from a Twain source and would like to get a FIBITMAP.
How can I convert the BITMAPINFO?
I found the solution, I needed to globally lock the memory:
Last edit: Sander Bouwhuis 2016-07-20