Unregistered
February 4, 2005, 11:34:18
I store a snapshot on a GDI+ bitmap. This bitmap become invalid if I close the the input device and reopen it. The program
crash when I try to write/paint on the GDI+ bitmap.
I initialize the GdiPlus, open the device and start the video.
This is the code of the snapshot:
BITMAPINFO *BitInfo;
Bitmap *BitM;
m_pGrabber->snapImages (1,1000);
if (m_pGrabber->getLastError () != eNOERROR)
Error_and_exit
DShowLib::Grabber::tMemBufferPtr gAMB = m_pGrabber->getActiveMemBuffer ();
gAMB->lock ();
smart_ptr<BITMAPINFOHEADER> pInf = gAMB->getBitmapInfoHeader ();
BitInfo = reinterpret_cast<LPBITMAPINFO>(&*pInf);
BitM = new Bitmap (BitInfo,gAMB->getPtr ());
gAMB->unlock ();
I develop under VC6++.
I can post you the source of a simple program to test the problem.
TIA
Paolo
crash when I try to write/paint on the GDI+ bitmap.
I initialize the GdiPlus, open the device and start the video.
This is the code of the snapshot:
BITMAPINFO *BitInfo;
Bitmap *BitM;
m_pGrabber->snapImages (1,1000);
if (m_pGrabber->getLastError () != eNOERROR)
Error_and_exit
DShowLib::Grabber::tMemBufferPtr gAMB = m_pGrabber->getActiveMemBuffer ();
gAMB->lock ();
smart_ptr<BITMAPINFOHEADER> pInf = gAMB->getBitmapInfoHeader ();
BitInfo = reinterpret_cast<LPBITMAPINFO>(&*pInf);
BitM = new Bitmap (BitInfo,gAMB->getPtr ());
gAMB->unlock ();
I develop under VC6++.
I can post you the source of a simple program to test the problem.
TIA
Paolo