private void uEyeInit() { // init variables m_bLive = false; m_bDrawing = false; m_bIsConnected = false; // set render mode //m_RenderMode = uEye.IS_RENDER_NORMAL; m_RenderMode = uEye.IS_RENDER_FIT_TO_WINDOW; // init our ueye object m_uEye = new uEye(); // enable static messages ( no open camera is needed ) m_uEye.EnableMessage(uEye.IS_NEW_DEVICE, hWndProc.ToInt32()); m_uEye.EnableMessage(uEye.IS_DEVICE_REMOVAL, hWndProc.ToInt32()); // init our image struct and alloc marshall pointers for the uEye memory m_UeyeImages = new UEYEIMAGE[IMAGE_COUNT]; int nLoop = 0; for (nLoop = 0; nLoop < IMAGE_COUNT; nLoop++) { m_UeyeImages[nLoop].pMemory = Marshal.AllocCoTaskMem(4); // create marshal object pointers m_UeyeImages[nLoop].MemID = 0; m_UeyeImages[nLoop].nSeqNum = 0; } }
public uEyeCamPlugin() { // The InitializeComponent() call is required for Windows Forms designer support. InitializeComponent(); // init our ueye object FuEyeCam = new uEye(); // enable static messages ( no open camera is needed ) FuEyeCam.EnableMessage(uEye.IS_NEW_DEVICE, this.Handle.ToInt32()); FuEyeCam.EnableMessage(uEye.IS_DEVICE_REMOVAL, this.Handle.ToInt32()); // init our image struct and alloc marshall pointers for the uEye memory FuEyeImages = new UEYEIMAGE[IMAGE_COUNT]; int nLoop = 0; for (nLoop = 0; nLoop < IMAGE_COUNT; nLoop++) { FuEyeImages[nLoop].pMemory = Marshal.AllocCoTaskMem(4); // create marshal object pointers FuEyeImages[nLoop].MemID = 0; FuEyeImages[nLoop].nSeqNum = 0; } }