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

📄 layerprodlg.cpp

📁 c语言实现的遥感图像处理的一些基本操作
💻 CPP
字号:
// LayerProDlg.cpp : implementation file
//

#include "stdafx.h"
#include "RSImageStar.h"
#include "MainFrm.h"

#include "LayerProDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CLayerProDlg dialog

CLayerProDlg::CLayerProDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CLayerProDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CLayerProDlg)
	m_StrName = _T("");
	//}}AFX_DATA_INIT
	LayerColor=RGB(255,0,0);
	m_Color.rgbtBlue=0;
	m_Color.rgbtGreen=0;
	m_Color.rgbtRed=255;
	m_Draw=true;
}


void CLayerProDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLayerProDlg)
	DDX_Control(pDX, IDC_BUTTON1, m_pButton);
	DDX_Text(pDX, IDC_EDIT1, m_StrName);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CLayerProDlg, CDialog)
	//{{AFX_MSG_MAP(CLayerProDlg)
	ON_BN_CLICKED(IDC_LAYER_COLOR1, SetLayerColor)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLayerProDlg message handlers


void CLayerProDlg::SetLayerColor(COLORREF color)
{
	CColorDialog dlgColor;
	if (dlgColor.DoModal() == IDOK)
		color = dlgColor.GetColor();
	else
		return;
	LayerColor=color;
	m_LayerColor.SetColor(LayerColor);
	m_Color.rgbtRed=BYTE(color&0xFF);
	m_Color.rgbtGreen=BYTE((color>>8)&0xFF);
	m_Color.rgbtBlue=BYTE((color>>16)&0xFF);
}

void CLayerProDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here
	if(m_Draw)
	{
		m_pButton.GetWindowRect(&rect);
		ScreenToClient(rect);
		m_LayerColor.Create(NULL, BS_OWNERDRAW|WS_BORDER|BS_CHECKBOX, 
			rect, this, IDC_LAYER_COLOR1);
		m_LayerColor.SetColor(LayerColor);
		m_LayerColor.ShowWindow(SW_SHOWNORMAL);	
		m_Draw=false;
	}
	// Do not call CDialog::OnPaint() for painting messages
}

⌨️ 快捷键说明

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