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

📄 drawview.h

📁 采用VC6.0做的一个画图板程序
💻 H
字号:
// drawView.h : interface of the CDrawView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_DRAWVIEW_H__38165A0F_42B4_4FF5_BF55_A8A0FF906A32__INCLUDED_)
#define AFX_DRAWVIEW_H__38165A0F_42B4_4FF5_BF55_A8A0FF906A32__INCLUDED_

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

typedef struct
{
	double x,y;
}	DPoint;

class CLine
{
public:
	CLine();
	~CLine();
	int m_LinesNum;
	CPoint m_StartPoint[100];
	CPoint m_EndPoint[100];	
	void AddLine(CPoint StartPoint,CPoint EndPoint);
	void DrawLine(CClientDC * pDC);
};

class CHandPoints
{
public:
	CHandPoints();
	~CHandPoints();
	int m_PointsNum;
	CPoint m_Point[1024];
	void AddPoint(CPoint Point);
	void DrawPoint(CClientDC * pDC);
};

class CNewRect
{
public:
	void DrawRect(CClientDC * pDC);
	void AddRect(CPoint StartPoint,CPoint EndPoint);
	int m_RectsNum;
	CNewRect();
	CPoint m_StartPoint[100];
	CPoint m_EndPoint[100];
};

class CEllipse
{
public:
	void DrawEllipse(CClientDC * pDC);
	void AddEllipse(CPoint StartPoint,CPoint EndPoint);
	int m_EllipsesNum;
	CEllipse();
	CPoint m_StartPoint[100];
	CPoint m_EndPoint[100];
};

class CBezier
{
public:
	CEllipse();

	int m_CtrNum[100][100];	
	CPoint m_CtrPoints[100][100];

	void DrawBeziers(CClientDC * pDC);
	void AddBezier(CPoint bezier_ctrpoints);
};

class Modifys
{
};

class CDrawView : public CView
{
protected: // create from serialization only
	CDrawView();
	DECLARE_DYNCREATE(CDrawView)
	CPoint m_TargetPos;
	CPoint m_OriginPos;
// Attributes
public:
	CDrawDoc* GetDocument();
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDrawView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL
// Implementation
public:	
	virtual ~CDrawView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CDrawView)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnDrawLine();
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnCancelMode();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnDrawRect();
	afx_msg void OnDrawEllipse();
	afx_msg void OnDrawBezier();
	afx_msg void OnDrawBspline();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnDrawCircle();
	afx_msg void OnDrawCube();
	afx_msg void OnToolPen();
	afx_msg void OnDrawConfig();
	afx_msg void OnDdaTest();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	CHandPoints m_handpoints;
	CEllipse m_ellipses;
	CNewRect m_rects;
	CLine m_lines;
	DPoint m_BezierPoints[100];
	int m_BezierPointNum;
	void DrawBezier(DPoint * p,int n,CClientDC * m_pDC);
	bool m_IsDrawing;
	int m_nDrawType;
};

#ifndef _DEBUG  // debug version in drawView.cpp
inline CDrawDoc* CDrawView::GetDocument()
   { return (CDrawDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_DRAWVIEW_H__38165A0F_42B4_4FF5_BF55_A8A0FF906A32__INCLUDED_)

⌨️ 快捷键说明

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