captureframesdlg.cpp

来自「我近期从事视频开发所以将我参考的资料上传给大家看看。」· C++ 代码 · 共 64 行

CPP
64
字号
#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 + =
减小字号Ctrl + -
显示快捷键?