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

📄 picset.cpp

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

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

/////////////////////////////////////////////////////////////////////////////
// picset dialog


picset::picset(CWnd* pParent /*=NULL*/)
	: CDialog(picset::IDD, pParent)
{
	//{{AFX_DATA_INIT(picset)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void picset::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(picset)
	DDX_Control(pDX, IDC_LIST1, m_list1);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(picset, CDialog)
	//{{AFX_MSG_MAP(picset)
	ON_WM_CTLCOLOR()
	ON_WM_VSCROLL()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// picset message handlers

BOOL picset::OnInitDialog() 
{
	CDialog::OnInitDialog();
	// TODO: Add extra initialization here
	CString compress[3]={"高质量","中等质量","低质量"};
	CString division[5]={"160×120分辨率","176×144分辨率","320×240分辨率","352×288分辨率","640×480分辨率"};
	CString color[2]={"黑白","彩色"};
	for(int i=0;i<5;i++)
	{
		for(int j=0;j<3;j++)
		{
			for(int k=0;k<2;k++)
			{CString ss=division[i]+" "+compress[j]+" "+color[k];
			 m_list1.AddString(ss);
			}
		}
	}
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
}

void picset::OnOK() 
{
 WORD picturemode[30]={0x0537,0x0a6e,0x0f59,0x11eb,0x14dc,0x1b85,0x1eb2,0x23d6,
                  0x26e1,0x29b8,0x2c8f,0x323d,0x370a,0x3853,0x3d64,0x4298,
				  0x47ac,0x48f5,0x4dc2,0x5370,0x5647,0x591e,0x5c29,0x614d,
				  0x647a,0x6b23,0x6e14,0x70a6,0x7591,0x7ac8};

	((CMoinorCentreDlg*)GetParent())->picmode=picturemode[m_list1.GetCurSel()];
	CString filename;
		
	m_list1.GetText(m_list1.GetCurSel(),filename);
    ((CMoinorCentreDlg*)GetParent())->pic_width=atoi(filename.Mid(0,3));
    ((CMoinorCentreDlg*)GetParent())->pic_height=atoi(filename.Mid(5,3));
	((CMoinorCentreDlg*)GetParent())->filefullname.Format("D:\\jpegfilehead\\%s.jpg",filename);
	
	CDialog::OnOK();
}

HBRUSH picset::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 || nCtlColor == CTLCOLOR_LISTBOX )
	{	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;
}

void picset::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
this->Invalidate();	
	CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}

⌨️ 快捷键说明

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