public bool startLiveMode() { uint resnum = myCamera.ResolutionNumber; if (myCamera.get_eSize(out eSize)) { if (myCamera.get_Size(out width, out height)) { if (liveBm != null) { liveBm.Dispose(); } liveBm = new Bitmap(width, height, PixelFormat.Format24bppRgb); if (!myCamera.StartPullModeWithWndMsg(camHandle, MSG_CAMEVENT)) { MessageBox.Show("failed to start device"); return(false); } else { return(true); } } else { return(false); } } else { return(false); } }