Exemplo n.º 1
0
        /// <summary>
        /// 云台控制
        /// </summary>
        /// <param name="playHandle"></param>
        /// <param name="controlType"></param>
        /// <param name="stopFlag"></param>
        /// <param name="speed"></param>
        /// <returns></returns>
        public bool PTZControl(int playHandle, SMPTZControlType controlType, int stopFlag, int speed)
        {
            int ptzControlInt = -1;

            switch (controlType)
            {
            case SMPTZControlType.Up:
                ptzControlInt = CHCNetSDK.TILT_UP;
                break;

            case SMPTZControlType.Down:
                ptzControlInt = CHCNetSDK.TILT_DOWN;
                break;

            case SMPTZControlType.Left:
                ptzControlInt = CHCNetSDK.PAN_LEFT;
                break;

            case SMPTZControlType.Right:
                ptzControlInt = CHCNetSDK.PAN_RIGHT;
                break;

            case SMPTZControlType.UpLeft:
                ptzControlInt = CHCNetSDK.UP_LEFT;
                break;

            case SMPTZControlType.UpRight:
                ptzControlInt = CHCNetSDK.UP_RIGHT;
                break;

            case SMPTZControlType.DownLeft:
                ptzControlInt = CHCNetSDK.DOWN_LEFT;
                break;

            case SMPTZControlType.DownRight:
                ptzControlInt = CHCNetSDK.DOWN_RIGHT;
                break;

            case SMPTZControlType.ZoomIn:
                ptzControlInt = CHCNetSDK.ZOOM_IN;
                break;

            case SMPTZControlType.ZoomOut:
                ptzControlInt = CHCNetSDK.ZOOM_OUT;
                break;
            }

            if (ptzControlInt == -1)
            {
                return(false);
            }

            return(CHCNetSDK.NET_DVR_PTZControlWithSpeed(playHandle, (uint)ptzControlInt, (uint)stopFlag, (uint)speed));
        }
Exemplo n.º 2
0
        public bool PTZControl(long playHandle, PTZControlType controlType, int stopFlag, int speed)
        {
            SMPTZControlType smControlType = (SMPTZControlType)((int)controlType);

            return(SMClient.Instance.PTZControl((int)playHandle, smControlType, stopFlag, speed));
        }