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

📄 drawbase.h

📁 这是一个程序的一般架构方法
💻 H
字号:
//-- {CycleCode: 334} file [0..2918]
//-- {StartSubRegion: 341} module.ifndef [0..240]
// DrawBase.h: interface for the CDrawBase class.
// 对GDI封装 用于最底层的绘画功能
//////////////////////////////////////////////////////////////////////


#if !defined(AFX_DRAWBASE_H__C75CF97D_742B_44A8_806A_80A3C24346E0__INCLUDED_)
//-- {StartSubRegion: 342} module.define [241..313]
#define AFX_DRAWBASE_H__C75CF97D_742B_44A8_806A_80A3C24346E0__INCLUDED_
//-- {InsertRegion: 344} module.vulnerableDeclarations [314..379]
//## begin module.additionalDeclarations preserve=yes

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

//## end module.additionalDeclarations
//-- {AddDecl: 335} region.inlineAnnotation [380..379]
//-- {InsertRegion: 345} module.vulnerableDeclarations [314..379]
//## begin module.additionalDeclarations preserve=yes

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

//## end module.additionalDeclarations
//-- {AddDecl: 336} class [380..1261]
class __declspec(dllexport) CDrawBase
{
//-- {AddDecl: 337} region.generated [422..1259]
public:
	CDrawBase();
	CDrawBase(HWND hWnd);
	virtual ~CDrawBase(void);
public:
	//开始在内存中绘图
	void BeginDraw();
	//内存中的图拷贝到屏幕
	void EndDraw();
	//设背景色
	void SetBKColor(DWORD dwColor);
	//设画笔
	void SetPen( int nPenStyle,int nWidth , COLORREF crColor);
	//圆
	void DrawCircle(POINT p1,UINT r);
	//多义线
	void Ployline(POINT * pPo , int nCount);
	//点
	void Point(POINT P1);
	//线段
	void Line(POINT p1,POINT p2);
	
	//窗口宽
	int GetDrawWidth();
	//窗口高
	int GetDrawHeight();
	//获取窗句柄
	void SetNewHWND(HWND hwnd);
	//清除内存
	void Clear();
	
protected:
	HDC m_hOffscreenDC;
	HBITMAP m_hOffscreenBuffer;
	int m_nOffscreenCX, m_nOffscreenCY;
	DWORD m_dwoffscreenBKCollor;
	HWND m_hWnd;
	HDC m_hDC;
	
	CDC m_DrawCDC;
	BOOL m_isInited;
protected:
	//
	void Init();
};


#endif // !defined(AFX_DRAWBASE_H__C75CF97D_742B_44A8_806A_80A3C24346E0__INCLUDED_) 

⌨️ 快捷键说明

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