public bool VideoPTZControl(Enum_VideoPTZControl PTZControl, bool bolStart) { bool bolResult = false; SDK_EzvizSDK.PTZAction ptzAction = bolStart ? SDK_EzvizSDK.PTZAction.START : SDK_EzvizSDK.PTZAction.STOP; SDK_EzvizSDK.PTZCommand ptzCommand = SDK_EzvizSDK.PTZCommand.AUTO; switch (PTZControl) { case Enum_VideoPTZControl.PTZControl_Up: ptzCommand = SDK_EzvizSDK.PTZCommand.UP; break; case Enum_VideoPTZControl.PTZControl_Down: ptzCommand = SDK_EzvizSDK.PTZCommand.DOWN; break; case Enum_VideoPTZControl.PTZControl_Left: ptzCommand = SDK_EzvizSDK.PTZCommand.LEFT; break; case Enum_VideoPTZControl.PTZControl_Right: ptzCommand = SDK_EzvizSDK.PTZCommand.RIGHT; break; case Enum_VideoPTZControl.PTZControl_LeftUp: ptzCommand = SDK_EzvizSDK.PTZCommand.UPLEFT; break; case Enum_VideoPTZControl.PTZControl_LeftDown: ptzCommand = SDK_EzvizSDK.PTZCommand.DOWNLEFT; break; case Enum_VideoPTZControl.PTZControl_RightUp: ptzCommand = SDK_EzvizSDK.PTZCommand.UPRIGHT; break; case Enum_VideoPTZControl.PTZControl_RightDown: ptzCommand = SDK_EzvizSDK.PTZCommand.DOWNRIGHT; break; } IntPtr intptrdevSerial = Marshal.StringToHGlobalAnsi(CurrentVideoInfo.DVSAddress); SDK_EzvizSDK.OpenSDK_PTZCtrlEx(intptrSessionID, intptrdevSerial, CurrentCameraInfo.Channel, ptzCommand, ptzAction, 3); return(bolResult); }