📄 videowin.cpp
字号:
// VideoWin.cpp : implementation file
//
#include "stdafx.h"
#include "LaneSoft.h"
#include "VideoWin.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CVideoWin
CVideoWin::CVideoWin()
{
hinstDevice = LoadLibrary("cg200d32.dll");
hcg200 = BeginCG200(1);
CG200SetInpVideoWindow(hcg200,0,0,638,478);
}
CVideoWin::~CVideoWin()
{
EndCG200(hcg200);
}
BEGIN_MESSAGE_MAP(CVideoWin, CStatic)
//{{AFX_MSG_MAP(CVideoWin)
ON_WM_CREATE()
ON_MESSAGE(WM_START_VIDEO,OnVideoStart)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CVideoWin message handlers
int CVideoWin::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatic::OnCreate(lpCreateStruct) == -1)
return -1;
// CG200SetADParam ( hcg200, AD_SOURCE, 2 );
CRect rect;
GetClientRect(&rect);
MapWindowPoints(NULL,&rect);
CG200SetDispWindow(hcg200,(int)rect.left,(int)rect.top,rect.Width(),rect.Height());
CG200Capture(hcg200,TRUE);
// TODO: Add your specialized creation code here
return 0;
}
LONG CVideoWin::OnVideoStart(UINT wParam,LONG lParam)
{
CRect rect;
if(wParam == 0)
{
GetClientRect(&rect);
MapWindowPoints(NULL,&rect);
CG200SetDispWindow(hcg200,(int)rect.left,(int)rect.top,rect.Width(),rect.Height());
// CG200SetADParam ( hcg200, AD_SOURCE, 2 );
CG200Capture(hcg200,TRUE);
}
else
{
CG200Capture(hcg200,FALSE);
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -