Пример #1
0
        public void SetOutPutWindow()
        {
            System.Diagnostics.Debug.Assert(m_pHandle != IntPtr.Zero);
            IntPtr   buffer = new IntPtr();
            int      size   = 0;
            HVSTATUS status = USBCameraAPI.HVGetDeviceInfo(m_pHandle, HV_DEVICE_INFO.DESC_RESOLUTION, buffer, ref size);

            buffer = Marshal.AllocHGlobal(size);
            status = USBCameraAPI.HVGetDeviceInfo(m_pHandle, HV_DEVICE_INFO.DESC_RESOLUTION, buffer, ref size);
            USBCameraAPI.HV_VERIFY(status);
            int[] type = new int[64];
            Marshal.Copy(buffer, type, 0, 64);
            Marshal.FreeHGlobal(buffer);

            m_OutPutWindow.Width  = type[(int)m_kResolotion * 2];
            m_OutPutWindow.Height = type[(int)m_kResolotion * 2 + 1];

            status = USBCameraAPI.HVSetOutputWindow(m_pHandle, m_OutPutWindow.X, m_OutPutWindow.Y, m_OutPutWindow.Width, m_OutPutWindow.Height);
            USBCameraAPI.HV_VERIFY(status);
        }