📄 captureframesdlg.cpp
字号:
#include "stdafx.h"
#include "vidcap.h"
#include "CaptureFramesDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CCaptureFramesDlg::CCaptureFramesDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCaptureFramesDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCaptureFramesDlg)
m_sFilename = _T("");
//}}AFX_DATA_INIT
m_nFrames = 0;
}
void CCaptureFramesDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCaptureFramesDlg)
DDX_Control(pDX, IDC_FRAMES, m_ctrlFrames);
DDX_Text(pDX, IDC_FILENAME, m_sFilename);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCaptureFramesDlg, CDialog)
//{{AFX_MSG_MAP(CCaptureFramesDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CCaptureFramesDlg::OnOK()
{
//Validate our parameters
ASSERT(m_pCapWnd);
//Do the frame capture
if (m_nFrames == 0)
{
m_pCapWnd->CaptureSingleFrameOpen();
SetDlgItemText(IDCANCEL, _T("Cancel"));
}
m_pCapWnd->CaptureSingleFrame();
//Update the piece of prompt text
++m_nFrames;
CString sFrames;
sFrames.Format(_T("%d Frames"), m_nFrames);
SetDlgItemText(IDC_FRAMES, sFrames);
}
void CCaptureFramesDlg::OnCancel()
{
//Tidy up the frame capture
ASSERT(m_pCapWnd);
if (m_nFrames)
m_pCapWnd->CaptureSingleFrameClose();
//Let the parent class do its thing
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -