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

📄 drawcoord.h

📁 这是一个程序的一般架构方法
💻 H
字号:
// DrawCoord.h: interface for the CDrawCoord class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DRAWCOORD_H__C75CF97D_742B_44A8_806A_80A3C24346E0__INCLUDED_)
//-- {StartSubRegion: 342} module.define [241..313]
#define AFX_DRAWCOORD_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

//-- {AddDecl: 338} region.inlineAnnotation [1262..1530]
//////////////////////////////////////////////////////////////////////////
//1.绘元素。
//2.绘缓冲区的内容可清除的。(按元素绘,按HDC坐标绘)
//3.绘缓冲区的内容不可清除。(临时层的元素)
//////////////////////////////////////////////////////////////////////////

//-- {AddDecl: 339} class [1531..2826]
class CDrawCoord
{
	//-- {AddDecl: 340} region.generated [1574..2824]
public:
	void Attach(HWND hWnd);
	CDrawCoord(HWND hWnd);
	virtual ~CDrawCoord();
	CDrawCoord();
	//
	CRect2D GetViewRect();
	CRect2D GetViewRect(CPoint2D p1,CPoint2D p2);
	
	void ViewOffset(double dOffsetX,double dOffsetY);
	void ViewScale(double dScale);
	void ViewScale(double dScale , CPoint2D toPoint);
	
	BOOL CanRedo();
	BOOL CanUndo();
	void ViewRedo();
	void ViewUndo();
public:
	//这个函数不参与Undo Redo
	//所以不能在外部使用
	void ViewRect(CRect2D rect);
public:
	CPoint2D PointToP2D(POINT po);
	POINT P2DToPOINT(CPoint2D sp);
	void EndDraw();
	void BeginDraw();
	void SetPen(int nPenStyle,int nWidth ,COLORREF crColor);
	
	//圆
	void DrawCircle(CPoint2D p1,double r);
	//多义线
	void Ployline(CPoint2D * pPo , int nCount);
	//点
	void Point(CPoint2D P1);
	//线段
	void Line(CPoint2D p1,CPoint2D p2);
	//////////////////////////////////////////////////////////////////////////
	//
	//圆
	void DrawCircle(POINT p1, UINT r);
	//多义线
	void Ployline(POINT * pPo , int nCount);
	//点
	void Point(POINT P1);
	//线段
	void Line(POINT p1,POINT p2);
	
protected:
	CDrawBase m_DrawBase;
	CMatrix2D m_MatrixView;
	CMatrix2D m_MatrixViewInverse;
	Alignment<CRect2D> m_UnDoData;
	double  m_dScale;
};

//-- {StartSubRegion: 343} module.endif [2827..2918]
#endif // !defined(AFX_DRAWCOORD_H__C75CF97D_742B_44A8_806A_80A3C24346E0__INCLUDED_) 

⌨️ 快捷键说明

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