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

📄 picnum.cpp

📁 无线图象监控系统(用VC++编程)用数据库ACCESS存储图象
💻 CPP
字号:
// picnum.cpp : implementation file
//

#include "stdafx.h"
#include "MoinorCentre.h"
#include "picnum.h"
#include"MoinorCentreDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Cpicnum dialog


Cpicnum::Cpicnum(CWnd* pParent /*=NULL*/)
	: CDialog(Cpicnum::IDD, pParent)
{
	//{{AFX_DATA_INIT(Cpicnum)
	m_picnum = 0;
	//}}AFX_DATA_INIT
}


void Cpicnum::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Cpicnum)
	DDX_Text(pDX, IDC_EDIT1, m_picnum);
	DDV_MinMaxInt(pDX, m_picnum, 1, 240);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Cpicnum, CDialog)
	//{{AFX_MSG_MAP(Cpicnum)
	ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
	ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
	ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
	ON_WM_CTLCOLOR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Cpicnum message handlers

void Cpicnum::OnRadio1() 
{
m_radionum=0;	// TODO: Add your control notification handler code here
	
}

void Cpicnum::OnRadio2() 
{
m_radionum=1;	// TODO: Add your control notification handler code here
	
}

void Cpicnum::OnRadio3() 
{UpdateData();
m_radionum=2;	// TODO: Add your control notification handler code here
	
}

void Cpicnum::OnOK() 
{
	switch (m_radionum)
	{case 0:{((CMoinorCentreDlg*)GetParent())->picnummode=0xff;
				break;}
	case 1:{((CMoinorCentreDlg*)GetParent())->picnummode=0;
			break;}
	case 2:{UpdateData();
		((CMoinorCentreDlg*)GetParent())->picnummode=m_picnum;
		     break;
		   }
	}

	CDialog::OnOK();
}

BOOL Cpicnum::OnInitDialog() 
{   
	CDialog::OnInitDialog();
	m_picnum=1;
	UpdateData(FALSE);
	CDib beijing;
	 beijing.Load(".//res//dd.bmp");
	 CRect ff;
GetWindowRect(ff);
beijing.ChangeImageSize(ff.Width(),ff.Height());
  m_brush.CreateDIBPatternBrush(beijing.m_hDib,DIB_PAL_COLORS);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

HBRUSH Cpicnum::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
if(nCtlColor==CTLCOLOR_DLG)
           {
              return m_brush;
           }
	if(nCtlColor == CTLCOLOR_STATIC)
	{	pDC->SetBkMode(0);
		pDC->SetTextColor(RGB(255,100,70));
hbr = (HBRUSH)::GetStockObject(NULL_BRUSH);
	return hbr;
	}	
	// TODO: Return a different brush if the default is not desired
	return hbr;
}

⌨️ 快捷键说明

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