⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 colorbutton.cpp

📁 SDK DVR/DVS HIKVISION
💻 CPP
字号:
// ColorButton.cpp : implementation file
//

#include "stdafx.h"
#include "newclient.h"
#include "ColorButton.h"
#include "MyOutput.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

extern CMyOutput myoutput[MAXVIEWNUM];
extern WORD iActiveWndNumber;
DWORD inumber = 0;
/////////////////////////////////////////////////////////////////////////////
// CColorButton

CColorButton::CColorButton()
{
	m_iSubButtonNum = inumber++;
}

CColorButton::~CColorButton()
{
}


BEGIN_MESSAGE_MAP(CColorButton, CButton)
	//{{AFX_MSG_MAP(CColorButton)
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CColorButton message handlers
void CColorButton::OnLButtonDown(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	StockHandle = myoutput[iActiveWndNumber].m_iPlayhandle;
	if(StockHandle>=0)
	{
		switch(m_iSubButtonNum)
		{
		case 0:        //Tilt up
			NET_DVR_PTZControl_EX(StockHandle,TILT_UP,0);
			break;
		case 1:			//Tilt down
			NET_DVR_PTZControl_EX(StockHandle,TILT_DOWN,0);
			break;
		case 2:			//Pan left
			NET_DVR_PTZControl_EX(StockHandle,PAN_LEFT,0);
			break;
		case 3:			//Pan right
			NET_DVR_PTZControl_EX(StockHandle,PAN_RIGHT,0);
			break;
		case 4:         //Zoom in
			NET_DVR_PTZControl_EX(StockHandle,ZOOM_IN,0);
			break;
		case 5:			//Zoom out
			NET_DVR_PTZControl_EX(StockHandle,ZOOM_OUT,0);
			break;
		case 6:			//Focus near
			NET_DVR_PTZControl_EX(StockHandle,FOCUS_NEAR,0);
			break;
		case 7:			//Focus far
			NET_DVR_PTZControl_EX(StockHandle,FOCUS_FAR,0);
			break;
		case 8:			//Iris open
			NET_DVR_PTZControl_EX(StockHandle,IRIS_OPEN,0);
			break;
		case 9:			//Iris close
			NET_DVR_PTZControl_EX(StockHandle,IRIS_CLOSE,0);
			break;
		default:
			break;
		}
	}
	CButton::OnLButtonDown(nFlags, point);
}

void CColorButton::OnLButtonUp(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	StockHandle = myoutput[iActiveWndNumber].m_iPlayhandle;
	if(StockHandle>=0)
	{
		switch(m_iSubButtonNum)
		{
		case 0:        //Tile up
			if(!NET_DVR_PTZControl_EX(StockHandle,TILT_UP,1))
				AfxMessageBox("PTZ control failed!");
			break;
		case 1:			//Tilt down
			if(!NET_DVR_PTZControl_EX(StockHandle,TILT_DOWN,1))
				AfxMessageBox("PTZ control failed!");
			break;
		case 2:			//Pan left
			if(!NET_DVR_PTZControl_EX(StockHandle,PAN_LEFT,1))
				AfxMessageBox("PTZ control failed!");
			break;
		case 3:			//Pan right
			if(!NET_DVR_PTZControl_EX(StockHandle,PAN_RIGHT,1))
				AfxMessageBox("PTZ control failed!");
			break;
		case 4:         //Zoom in
			if(!NET_DVR_PTZControl_EX(StockHandle,ZOOM_IN,1))
				AfxMessageBox("Lens control failed!");
			break;
		case 5:			//Zoom out
			if(!NET_DVR_PTZControl_EX(StockHandle,ZOOM_OUT,1))
				AfxMessageBox("Lens control failed!");
			break;
		case 6:			//Focus near
			if(!NET_DVR_PTZControl_EX(StockHandle,FOCUS_NEAR,1))
				AfxMessageBox("Lens control failed!");
			break;
		case 7:			//Focus far
			if(!NET_DVR_PTZControl_EX(StockHandle,FOCUS_FAR,1))
				AfxMessageBox("Lens control failed!");
			break;
		case 8:			//Iris open
			if(!NET_DVR_PTZControl_EX(StockHandle,IRIS_OPEN,1))
				AfxMessageBox("Lens control failed!");
			break;
		case 9:			//Iris close
			if(!NET_DVR_PTZControl_EX(StockHandle,IRIS_CLOSE,1))
				AfxMessageBox("Lens control failed!");
			break;
		default:
			break;
		}
	}
	CButton::OnLButtonUp(nFlags, point);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -