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

📄 webcamdlg.h

📁 PC端通过WINCE端实现摄像功能
💻 H
字号:
// webcamDlg.h : header file
//

#if !defined(AFX_WEBCAMDLG_H__AF345E1F_712E_4771_B3EB_9699B8C3165B__INCLUDED_)
#define AFX_WEBCAMDLG_H__AF345E1F_712E_4771_B3EB_9699B8C3165B__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

/////////////////////////////////////////////////////////////////////////////
// CWebcamDlg dialog
#include ".\TCP\\TCPServer_CE.h"
#include ".\TCP\\TCPCustom_CE.h"
#include "afxwin.h"
class CWebcamDlg : public CDialog
{
// Construction
public:
	CWebcamDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CWebcamDlg)
	enum { IDD = IDD_WEBCAM_DIALOG };
	CButton	m_Save2File;
	CButton m_StartTCPServer;
	CButton m_CloseTCPServer;
	CButton m_StartCamera;
	CButton m_StopCamera;
	CButton	m_Exit;
	CComboBox	m_ctrlCamList;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CWebcamDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CWebcamDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnExit();
	afx_msg void OnClose();
	afx_msg void OnSaveToFile();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	HWND m_hDisplay;
	HANDLE m_hThread;
	BOOL m_fIsStop;
	HANDLE m_hStopEvent;
	BOOL m_fIsSave;
	static DWORD WINAPI CaptureThreadProc(LPVOID lpParameter);
	static LRESULT CALLBACK CaptureWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
	BOOL MakeJpeg(LPCTSTR jpgFileName, LPBYTE pJpgData, DWORD size);
private:
	//定义CTCPServer_CE对象
	CTCPServer_CE m_tcpServer;
private:
	//客户端连接建立事件处理函数
	static void CALLBACK	OnClientConnect(CWnd* pWnd,CTCPCustom_CE *pTcpCustom);
	//客户端SOCKET关闭事件处理函数
	static void  CALLBACK OnClientClose(CWnd* pWnd,CTCPCustom_CE*pTcpCustom);
	//服务器端收到来自客户端的数据
	static  void CALLBACK OnClientRead(CWnd* pWnd,CTCPCustom_CE* pTcpCustom,const char * buf,int len );
	//客户端Socket错误事件处理函数
	static  void CALLBACK OnClientError(CWnd* pWnd,CTCPCustom_CE* pTcpCustom,int nErrorCode);
	
	//服务器端Socket错误事件处理函数
	static void CALLBACK OnServerError(CWnd* pWnd,CTCPServer_CE* pTcpServer_CE,int nErrorCode);
	afx_msg void OnBnClickedStarttcpserver();
	afx_msg void OnBnClickedClosetcpserver();
	afx_msg void OnBnClickedStartcamera();
	afx_msg void OnBnClickedStopcamera();

};

//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_WEBCAMDLG_H__AF345E1F_712E_4771_B3EB_9699B8C3165B__INCLUDED_)

⌨️ 快捷键说明

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