⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientwnd.cpp

📁 利用web camera对目标进行特征跟踪的程序 对于初学机器视觉的有些帮助
💻 CPP
字号:
// ClientWnd.cpp : implementation file
//

#include "stdafx.h"
#include "图像特征跟踪系统.h"
#include "ClientWnd.h"
#include "ZXDib.h"

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

/////////////////////////////////////////////////////////////////////////////
// CClientWnd
static DWORD dwHeight,dwWidth;

CClientWnd::CClientWnd()
{
	pBitmapInfoBackGround=  NULL;
	pBitmapBackGround = NULL;
	
}

CClientWnd::~CClientWnd()
{
	if(pBitmapBackGround) delete pBitmapBackGround;
	if(pBitmapInfoBackGround) delete pBitmapInfoBackGround;

}


BEGIN_MESSAGE_MAP(CClientWnd, CWnd)
	//{{AFX_MSG_MAP(CClientWnd)
	ON_WM_ERASEBKGND()
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CClientWnd message handlers
BOOL CClientWnd::OnEraseBkgnd(CDC* pDC) 
{
	DWORD dwHeight,dwWidth;
	
	CBitmap bmp;
	bmp.LoadBitmap(IDB_BITMAP_BK);
	
	BITMAP stBitmap;
    bmp.GetObject(sizeof(BITMAP),&stBitmap); 
	dwHeight = stBitmap.bmHeight;
	dwWidth = stBitmap.bmWidth;

	CDC cdc;
	cdc.CreateCompatibleDC(pDC);
	cdc.SelectObject(&bmp);

	RECT rect;
	GetClientRect(&rect);

	pDC->SetStretchBltMode(COLORONCOLOR);
	pDC->StretchBlt(0,0,rect.right-rect.left,rect.bottom-rect.top,&cdc,0,0,(int)dwWidth,(int)dwHeight,SRCCOPY); 
	cdc.DeleteDC();

	return true;
}

void CClientWnd::OnSize(UINT nType, int cx, int cy) 
{
	CWnd::OnSize(nType, cx, cy);
	Invalidate(false);
}

WNDPROC* CClientWnd::GetSuperWndProcAddr() 
{
	static WNDPROC NEAR pfnSuper = NULL; 
	return &pfnSuper; // 返回函数指针 
} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -