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

📄 chapter5_2.h

📁 EVC下的画图实例
💻 H
字号:
// chapter5_2.h : main header file for the CHAPTER5_2 application
//

#if !defined(AFX_CHAPTER5_2_H__B5DE3B7E_096A_46A1_BBA4_47321FCBADDD__INCLUDED_)
#define AFX_CHAPTER5_2_H__B5DE3B7E_096A_46A1_BBA4_47321FCBADDD__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h"       // main symbols

/////////////////////////////////////////////////////////////////////////////
// CChapter5_2App:
// See chapter5_2.cpp for the implementation of this class
//

class CChapter5_2App : public CWinApp
{
public:
	CChapter5_2App();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CChapter5_2App)
	public:
	virtual BOOL InitInstance();
	//}}AFX_VIRTUAL

// Implementation

	//{{AFX_MSG(CChapter5_2App)
	afx_msg void OnAppAbout();
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};
class CColorPen  
{
public:
	CColorPen(HDC hdc,COLORREF color): _hdc (hdc)
	{
		_hPen=CreatePen(PS_SOLID,0,color);
		_hPenOld=(HPEN)SelectObject(_hdc,_hPen);
	}
	~CColorPen()
	{
		SelectObject(_hdc,_hPenOld);
		DeleteObject(_hPen);
	}

private:
	HDC		_hdc;
	HPEN	_hPen;
	HPEN	_hPenOld;
};

class CColorBrush
{
public:
	CColorBrush(HDC hdc,COLORREF color): _hdc (hdc)
	{
		_hBrush=CreateSolidBrush(color);
		_hBrushOld=(HBRUSH)SelectObject(_hdc,_hBrush);
	}
	~CColorBrush()
	{
		SelectObject(_hdc,_hBrushOld);
		DeleteObject(_hBrush);
	}
private:
	HDC		_hdc;
	HBRUSH	_hBrush;
	HBRUSH	_hBrushOld;
};


/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CHAPTER5_2_H__B5DE3B7E_096A_46A1_BBA4_47321FCBADDD__INCLUDED_)

⌨️ 快捷键说明

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