Home > Software engineering >  Two picture controls showed the same camera images
Two picture controls showed the same camera images

Time:10-11

 
//VCsampleDlg. CPP: implementation file
//

# include "stdafx. H"
# include "devwdm. H"
# include "VCsample. H"
# include "VCsampleDlg. H"

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

/////////////////////////////////////////////////////////////////////////////
//CAboutDlg dialog informs the for App About
//# include & lt; VFW. H>
The class CAboutDlg: public CDialog
{
Public:
CAboutDlg ();

//Dialog Data
//{{AFX_DATA (CAboutDlg)
Enum {IDD=IDD_ABOUTBOX};
//}} AFX_DATA

//ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL (CAboutDlg)
Protected:
Virtual void DoDataExchange (CDataExchange * symbol;//(DDX/DDV support
//}} AFX_VIRTUAL

//Implementation
Protected:
//{{AFX_MSG (CAboutDlg)
//}} AFX_MSG
DECLARE_MESSAGE_MAP ()
};

CAboutDlg: : CAboutDlg () : CDialog CAboutDlg: : (IDD)
{
//{{AFX_DATA_INIT (CAboutDlg)
//}} AFX_DATA_INIT
}

Void CAboutDlg: : DoDataExchange (CDataExchange * symbol)
{
CDialog: : DoDataExchange (symbol);
//{{AFX_DATA_MAP (CAboutDlg)
//}} AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP (CAboutDlg CDialog)
//{{AFX_MSG_MAP (CAboutDlg)
//No message handlers
//}} AFX_MSG_MAP
END_MESSAGE_MAP ()

/////////////////////////////////////////////////////////////////////////////
//CVCsampleDlg dialog

CVCsampleDlg: : CVCsampleDlg (pParent/*=NULL CWnd * */)
: CDialog (CVCsampleDlg: : IDD, pParent)
{
//{{AFX_DATA_INIT (CVCsampleDlg)
M_chkMirror=FALSE;
M_chkFlip=FALSE;
//}} AFX_DATA_INIT
//Note that LoadIcon does not require a subsequent DestroyIcon in Win32
M_hIcon=AfxGetApp () - & gt; LoadIcon (IDR_MAINFRAME);
}

Void CVCsampleDlg: : DoDataExchange (CDataExchange * symbol)
{
CDialog: : DoDataExchange (symbol);
//{{AFX_DATA_MAP (CVCsampleDlg)
DDX_Control (symbol, IDC_BUTTON_FREEZE m_btnFreeze);
DDX_Control (symbol, IDC_BUTTON_CAPTURE m_btnCapture);
DDX_Control (symbol, IDC_BUTTON_SNAP m_btnSnap);
DDX_Control (symbol, IDC_BUTTON_START m_btnStartPreview);
DDX_Control (symbol, IDC_VIDEO_WND m_hVideoCapture);
DDX_Control (symbol, IDC_VIDEO_WND1 m_hVideoCapture);
DDX_Check (symbol, IDC_CHECK1, m_chkMirror);
DDX_Check (symbol, IDC_CHECK2 m_chkFlip);
//}} AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP (CVCsampleDlg CDialog)
//{{AFX_MSG_MAP (CVCsampleDlg)
ON_WM_SYSCOMMAND ()
ON_WM_PAINT ()
ON_WM_QUERYDRAGICON ()
ON_BN_CLICKED (IDC_BUTTON_START OnButtonStart)
ON_WM_HSCROLL ()
ON_BN_CLICKED (IDC_BUTTON_SNAP OnButtonSnap)
ON_BN_CLICKED (IDC_BUTTON_CAPTURE OnButtonCapture)
ON_BN_CLICKED (IDC_BUTTON_FREEZE OnButtonFreeze)
ON_BN_CLICKED (IDC_CHECK1, OnCheck1)
ON_BN_CLICKED (IDC_CHECK2 OnCheck2)
ON_WM_TIMER ()
//}} AFX_MSG_MAP
ON_STN_CLICKED (IDC_VIDEO_WND, & amp; CVCsampleDlg: : OnStnClickedVideoWnd)
END_MESSAGE_MAP ()

/////////////////////////////////////////////////////////////////////////////
//CVCsampleDlg message handlers

BOOL CVCsampleDlg: : OnInitDialog ()
{
CDialog: : OnInitDialog ();

//Add "About... "Menu item to system menu.

//IDM_ABOUTBOX must be in the system command range.
ASSERT ((IDM_ABOUTBOX & amp; 0==IDM_ABOUTBOX xfff0));
ASSERT (IDM_ABOUTBOX & lt; 0 xf000);

CMenu * pSysMenu=GetSystemMenu (FALSE);
If (pSysMenu!=NULL)
{
Cstrings strAboutMenu;
StrAboutMenu. LoadString (IDS_ABOUTBOX);
if (! StrAboutMenu. IsEmpty ())
{
PSysMenu - & gt; The AppendMenu (MF_SEPARATOR);
PSysMenu - & gt; AppendMenu (MF_STRING IDM_ABOUTBOX, strAboutMenu);
}
}

//Set the icon for this dialog. The framework does this automatically
//when the application 's main window is not a dialog
SetIcon (m_hIcon, TRUE);//Set the big icon
SetIcon (m_hIcon, FALSE);//Set the small icon


LONG lRet ntotalcard=0;
LONG bright contrast, satu, hue;
LONG lMax, lMin lDefault;
DWORD dwMirror dwFlip;

M_boOpen=FALSE;
M_boCapture=FALSE;
M_nSlot=0;
//m_nSlot=1;

M_hVideoCapture. MoveWindow (0, 0, 352, 288);
M_hVideoCapture1. MoveWindow (0, 0, 352, 288);
Ntotalcard=devwdm_InitCard (m_nSlot, m_hVideoCapture. M_hWnd, 240, 180);
/* ntotalcard=devwdm_InitCard (m_nSlot1, m_hVideoCapture1. M_hWnd, 240, 180);
*/
If (ntotalcard & gt; 0)
{

LRet=devwdm_SetMirror (m_nSlot, & amp; DwMirror, 1);
LRet=devwdm_SetFlip (m_nSlot, & amp; DwFlip, 1);

LRet=devwdm_GetBrightNess (m_nSlot, & amp; Bright, & amp; LMax, & amp; LMin, & amp; LDefault);

CSliderCtrl * pSc=(CSliderCtrl *) GetDlgItem (IDC_SLIDER_BRIGHTNESS);
PSc - & gt; SetRange (lMin, lMax);
PSc - & gt; SetPos (bright); nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related