private static void ImageCallback(XCCAM XCCam, IntPtr pInBuf, UInt32 Length, UInt32 iWidth, UInt32 iHeight, XCCAM_IMAGEDATAINFO Info, IntPtr Context)
        {
            GCHandle         param = GCHandle.FromIntPtr(Context);
            frmCameraSetting VRef  = (frmCameraSetting)param.Target;
            Int64            TickCount;

            VRef.FrameCount++;
            TickCount = VRef.Frame.ElapsedTicks;
            if (TickCount >= Stopwatch.Frequency)
            {
                VRef.Fps        = VRef.FrameCount;
                VRef.FrameCount = 0;
                VRef.Frame.Restart();
                VRef.Fps *= Stopwatch.Frequency;
                VRef.Fps /= TickCount;
                if (!VRef.FpsUpdate.IsBusy)
                {
                    VRef.FpsUpdate.RunWorkerAsync();
                }
            }

            TickCount = VRef.DispExec.ElapsedTicks;
            if (TickCount >= (Stopwatch.Frequency / VRef.Dislay_FPS) || !VRef.Disp_Flag)
            {
                VRef.Disp_Flag = true;
                VRef.DispExec.Restart();
                XCCam.BufferConvExec(pInBuf, VRef.RGBData);
                if (!VRef.DisplayUpdate.IsBusy)
                {
                    VRef.DisplayUpdate.RunWorkerAsync();
                }
            }
        }
        private static void SystemCallback(STATUS_SYSTEMCODE SystemStatus, IntPtr Context)
        {
            GCHandle         param         = GCHandle.FromIntPtr(Context);
            frmCameraSetting CameraListRef = (frmCameraSetting)param.Target;

            switch (SystemStatus)
            {
            case STATUS_SYSTEMCODE.STATUSXCCAM_BUSRESET:     // Processing of bus reset
                if (!CameraListRef.BusResetWorker.IsBusy)
                {
                    CameraListRef.BusResetWorker.RunWorkerAsync();
                }
                break;

            case STATUS_SYSTEMCODE.STATUSXCCAM_POWERUP:     // Processing of PowerUP
                break;
            }
        }
Exemple #3
0
        private void btnCameraSetting_Click(object sender, EventArgs e)
        {
            frmCameraSetting frmDlg = new frmCameraSetting();

            frmDlg.ShowDialog();
        }