Exemplo n.º 1
0
 private void FrmVideoConfig_Load(object sender, EventArgs e)
 {
     if (StaticClass.tempConnect < 0 || StaticClass.tempMonitor < 0)
     {
         MessageBox.Show("连接失败,请重试!");
         foreach (Control control in this.Controls)
         {
             control.Enabled = false;
         }
         return;
     }
     else
     {
         #region//显示位置归零
         //DMSDK.DM_SetOSDInfo_DateTime(StaticClass.tempConnect, 1, 100, 0);
         //DMSDK.DM_SetOSDInfo_CameraName(StaticClass.tempConnect, tbxCameraName.Text, 1,  0, 0);
         //DMSDK.DM_GetOSDInfo_UserDefine(StaticClass.intPtrs_Operate[iPCameraId - 1], cUserDefineInfo, out iDisplayUserDefineInfo, out iDisplayUserDefineInfoX, out iDisplayUserDefineInfoY);//自定义信息
         #endregion
         string automaticTime = ConfigurationManager.AppSettings["Automatictiming"];
         if (automaticTime == "0")
         {
             rdbAutomatictime_Off.Checked = true;
         }
         else
         {
             rdbAutomatictime_On.Checked = true;
         }
         DMSDK.DM_GetDM6xResolution(StaticClass.tempConnect, ref tagResolutionInfo);//获取分辨率
         DMSDK.DM_GetEncodingInfo_Major(StaticClass.tempConnect, ref Major_BitrateType, ref Major_Resolution, ref Major_Bitrate, ref Major_FrameRate);
         DMSDK.DM_GetEncodingInfo_Minor(StaticClass.tempConnect, ref Minor_BitrateType, ref Minor_Resolution, ref Minor_Bitrate, ref Minor_FrameRate);
         DMSDK.DM_GetOSDInfo_CameraName(StaticClass.tempConnect, cCameraName, out iDisplayName, out iDisplayNameX, out iDisplayNameY); //cCameraName 乱码 未解决
         DMSDK.DM_GetOSDInfo_DateTime(StaticClass.tempConnect, out iDisplayTime, out iDisplayTimeX, out iDisplayTimeY);
         DMSDK.DM_GetDateTime(StaticClass.tempConnect, dateTime);                                                                      //RTM的难搞
         dtpCameraDateTime.Value = Convert.ToDateTime(dateTime.ToString());                                                            //获取相机的系统时间并显示
         if (iDisplayName == 0)
         {
             rdbNotCameraName.Checked = true;
         }
         else
         {
             rdbIsCameraName.Checked = true;
         }
         if (iDisplayTime == 0)
         {
             rdbNotTime.Checked = true;
         }
         else
         {
             rdbIsTime.Checked = true;
         }
         DMSDK.DM_SetOSDInfo_CameraName(StaticClass.tempConnect, StaticClass.Temper_CameraName, iDisplayName, iDisplayNameX, iDisplayNameY);
         tbxCameraName.Text = StaticClass.Temper_CameraName;
         rdbMajor.Checked   = true;
     }
 }
Exemplo n.º 2
0
 private void btnLocationDown_Click(object sender, EventArgs e)
 {
     if (rdbCNameLocation.Checked == true && (iDisplayNameY + 10 + trbLocation.Value) < tagResolutionInfo.height)
     {
         DMSDK.DM_SetOSDInfo_CameraName(StaticClass.tempConnect, StaticClass.Temper_CameraName, 1, iDisplayNameX, iDisplayNameY + trbLocation.Value);
         DMSDK.DM_GetOSDInfo_CameraName(StaticClass.tempConnect, cCameraName, out iDisplayName, out iDisplayNameX, out iDisplayNameY);
     }
     else if (rdbCTimeLocation.Checked == true && (iDisplayTimeY + 10 + trbLocation.Value) < tagResolutionInfo.height)
     {
         DMSDK.DM_SetOSDInfo_DateTime(StaticClass.tempConnect, iDisplayTime, iDisplayTimeX, iDisplayTimeY + trbLocation.Value);
         DMSDK.DM_GetOSDInfo_DateTime(StaticClass.tempConnect, out iDisplayTime, out iDisplayTimeX, out iDisplayTimeY);
     }
 }
Exemplo n.º 3
0
 private void btnLocationUp_Click(object sender, EventArgs e)
 {
     if (rdbCNameLocation.Checked == true && (iDisplayNameY - trbLocation.Value) > 0)
     {
         DMSDK.DM_SetOSDInfo_CameraName(tempConnect, StaticClass.Temper_CameraName, 1, iDisplayNameX, iDisplayNameY - trbLocation.Value);
         DMSDK.DM_GetOSDInfo_CameraName(tempConnect, cCameraName, out iDisplayName, out iDisplayNameX, out iDisplayNameY);
     }
     else if (rdbCTimeLocation.Checked == true && (iDisplayTimeY - trbLocation.Value) > 0)
     {
         DMSDK.DM_SetOSDInfo_DateTime(tempConnect, iDisplayTime, iDisplayTimeX, iDisplayTimeY - trbLocation.Value);
         DMSDK.DM_GetOSDInfo_DateTime(tempConnect, out iDisplayTime, out iDisplayTimeX, out iDisplayTimeY);
     }
 }
Exemplo n.º 4
0
 private void FrmVideoConfig_Load(object sender, EventArgs e)
 {
     tempConnect = DMSDK.DM_Connect(this.Handle, StaticClass.Temper_Ip, 80);
     if (tempConnect > 0)
     {
         tempMonitor = DMSDK.DM_OpenMonitor(pbxVideo.Handle, StaticClass.Temper_Ip, 5000, 0);
     }
     if (tempConnect < 0 || tempMonitor < 0)
     {
         MessageBox.Show("连接失败,请重试!");
     }
     else
     {
         #region//显示位置归零
         //DMSDK.DM_SetOSDInfo_DateTime(tempConnect, 1, 100, 0);
         //DMSDK.DM_SetOSDInfo_CameraName(tempConnect, tbxCameraName.Text, 1,  0, 0);
         //DMSDK.DM_GetOSDInfo_UserDefine(StaticClass.intPtrs_Operate[iPCameraId - 1], cUserDefineInfo, out iDisplayUserDefineInfo, out iDisplayUserDefineInfoX, out iDisplayUserDefineInfoY);//自定义信息
         #endregion
         DMSDK.DM_GetDM6xResolution(tempConnect, ref tagResolutionInfo);//获取分辨率
         tempConnect = DMSDK.DM_Connect(pbxVideo.Handle, StaticClass.Temper_Ip, 80);
         tempMonitor = DMSDK.DM_OpenMonitor(pbxVideo.Handle, StaticClass.Temper_Ip, 5000, 0);
         DMSDK.DM_GetEncodingInfo_Major(tempConnect, ref Major_BitrateType, ref Major_Resolution, ref Major_Bitrate, ref Major_FrameRate);
         DMSDK.DM_GetEncodingInfo_Minor(tempConnect, ref Minor_BitrateType, ref Minor_Resolution, ref Minor_Bitrate, ref Minor_FrameRate);
         DMSDK.DM_GetOSDInfo_CameraName(tempConnect, cCameraName, out iDisplayName, out iDisplayNameX, out iDisplayNameY); //cCameraName 乱码 未解决
         DMSDK.DM_GetOSDInfo_DateTime(tempConnect, out iDisplayTime, out iDisplayTimeX, out iDisplayTimeY);
         DMSDK.DM_GetDateTime(tempConnect, dateTime);                                                                      //RTM的难搞
         dtpCameraDateTime.Value = Convert.ToDateTime(dateTime.ToString());                                                //获取相机的系统时间并显示
         if (iDisplayName == 0)
         {
             rdbNotCameraName.Checked = true;
         }
         else
         {
             rdbIsCameraName.Checked = true;
         }
         if (iDisplayTime == 0)
         {
             rdbNotTime.Checked = true;
         }
         else
         {
             rdbIsTime.Checked = true;
         }
         DMSDK.DM_SetOSDInfo_CameraName(tempConnect, StaticClass.Temper_CameraName, iDisplayName, iDisplayNameX, iDisplayNameY);
         tbxCameraName.Text = StaticClass.Temper_CameraName;
         rdbMajor.Checked   = true;
     }
 }