📄 dlgsetflash.cpp
字号:
// DlgSetFlash.cpp : implementation file
//
#include "stdafx.h"
#include "videocapture.h"
#include "DlgSetFlash.h"
#include "VideoCaptureView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgSetFlash dialog
CDlgSetFlash::CDlgSetFlash(CWnd* pParent /*=NULL*/)
: CDialog(CDlgSetFlash::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgSetFlash)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDlgSetFlash::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgSetFlash)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgSetFlash, CDialog)
//{{AFX_MSG_MAP(CDlgSetFlash)
ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
ON_EN_CHANGE(IDC_EDIT2, OnChangeEdit2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgSetFlash message handlers
void CDlgSetFlash::OnChangeEdit1()
{
CVideoCaptureView* pView=CVideoCaptureView::GetView();
if (!pView)
return;
CString text;
GetDlgItem(IDC_EDIT1)->GetWindowText(text);
int a;
try
{
a=atoi(text);
}
catch (...) {
a=0;
}
if ( a>255)
{
a=255;
}
pView->FlashDelay=a;
// text.Format("%d",a);
// GetDlgItem(IDC_EDIT1)->SetWindowText(text);
}
BOOL CDlgSetFlash::OnInitDialog()
{
CDialog::OnInitDialog();
CVideoCaptureView* pView=CVideoCaptureView::GetView();
if (!pView)
return FALSE;
CString text="";
text.Format("%d",pView->FlashDelay);
GetDlgItem(IDC_EDIT1)->SetWindowText(text);
text.Format("%d",pView->CapDelay);
GetDlgItem(IDC_EDIT2)->SetWindowText(text);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgSetFlash::OnChangeEdit2()
{
CVideoCaptureView* pView=CVideoCaptureView::GetView();
if (!pView)
return;
CString text;
GetDlgItem(IDC_EDIT2)->GetWindowText(text);
int a;
try
{
a=atoi(text);
}
catch (...) {
a=0;
}
if ( a>1000)
{
a=1000;
}
pView->CapDelay=a;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -