📄 combinedlg.cpp
字号:
// CombineDlg.cpp : implementation file
//
#include "stdafx.h"
#include "RSImageStar.h"
#include "CombineDlg.h"
#include "RSImageStarDoc.h"
#include "RSImageStarView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCombineDlg dialog
extern CRSImageStarView *m_pView;
CCombineDlg::CCombineDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCombineDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCombineDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// m_pRedImage = NULL;
// m_pGreenImage = NULL;
// m_pBlueImage = NULL;
}
void CCombineDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCombineDlg)
DDX_Control(pDX, IDC_RED_CHANNEL, m_ctrlRedChannel);
DDX_Control(pDX, IDC_GREEN_CHANNEL, m_ctrlGreenChannel);
DDX_Control(pDX, IDC_BLUE_CHANNEL, m_ctrlBlueChannel);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCombineDlg, CDialog)
//{{AFX_MSG_MAP(CCombineDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCombineDlg message handlers
BOOL CCombineDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CSize size=m_pView->m_pDoc->size;
POSITION posTemplate = AfxGetApp()->GetFirstDocTemplatePosition();
while (posTemplate != NULL)
{
CDocTemplate* pTemplate = AfxGetApp()->GetNextDocTemplate(posTemplate);
ASSERT(pTemplate->IsKindOf(RUNTIME_CLASS(CDocTemplate)));
POSITION posDoc = pTemplate->GetFirstDocPosition();
while (posDoc != NULL)
{
CRSImageStarDoc* pDoc = (CRSImageStarDoc*) pTemplate->GetNextDoc(posDoc);
ASSERT(pDoc->IsKindOf(RUNTIME_CLASS(CRSImageStarDoc)));
if((size.cx==pDoc->size.cx)&&(size.cy==pDoc->size.cy))
{
m_ctrlRedChannel.AddString(pDoc->GetTitle());
m_ctrlRedChannel.SetItemData(m_ctrlRedChannel.GetCount()-1, (DWORD) pDoc);
m_ctrlGreenChannel.AddString(pDoc->GetTitle());
m_ctrlGreenChannel.SetItemData(m_ctrlGreenChannel.GetCount()-1, (DWORD) pDoc);
m_ctrlBlueChannel.AddString(pDoc->GetTitle());
m_ctrlBlueChannel.SetItemData(m_ctrlBlueChannel.GetCount()-1, (DWORD) pDoc);
}
}
}
m_ctrlRedChannel.SetCurSel(0);
m_ctrlGreenChannel.SetCurSel(0);
m_ctrlBlueChannel.SetCurSel(0);
return TRUE;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CCombineDlg::OnOK()
{
// TODO: Add extra validation here
CRSImageStarDoc* pRedDoc= (CRSImageStarDoc*) m_ctrlRedChannel.GetItemData(m_ctrlRedChannel.GetCurSel());
m_pRedImage.SetDataPtr(pRedDoc->head->dib);
CRSImageStarDoc* pGreenDoc = (CRSImageStarDoc*) m_ctrlGreenChannel.GetItemData(m_ctrlGreenChannel.GetCurSel());
m_pGreenImage.SetDataPtr(pGreenDoc->head->dib);
CRSImageStarDoc* pBlueDoc = (CRSImageStarDoc*) m_ctrlBlueChannel.GetItemData(m_ctrlBlueChannel.GetCurSel());
m_pBlueImage.SetDataPtr(pBlueDoc->head->dib);
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -