public IntPtr GetBitMap()
{
if (m_handle == IntPtr.Zero)
m_handle = Marshal.AllocCoTaskMem(m_stride*m_videoHeight);
try
{
// Start waiting
// if (!m_PictureReady.WaitOne(5000, false))
{
//throw new Exception("Timeout waiting to get picture");
}
}
catch
{
Marshal.FreeCoTaskMem(m_handle);
throw;
}
// Got one
return m_handle;
}