line.h

来自「VC程序设计技巧与实例(2)关于窗口和桌面系统、文件和系统操作、消息影射的原代码」· C头文件 代码 · 共 29 行

H
29
字号
// Line.h: interface for the CLine class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LINE_H__F4B2EF31_3279_460E_B516_BA1A68FB87D1__INCLUDED_)
#define AFX_LINE_H__F4B2EF31_3279_460E_B516_BA1A68FB87D1__INCLUDED_

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

class CLine : public CObject  
{
public:
	CLine();	//无参数构造函数
	CLine(const CLine& other);	//拷贝构造函数
	virtual ~CLine();			//析构函数
	CLine & operator=(const CLine& other);//赋值函数
	void Draw(CDC*  pDC);		//画直线段
	void SetStartPnt(CPoint point);
	void SetEndPnt(CPoint point);
private:
	CPoint  m_nStartPnt;		//起点
	CPoint  m_nEndPnt;			//终点

};

#endif // !defined(AFX_LINE_H__F4B2EF31_3279_460E_B516_BA1A68FB87D1__INCLUDED_)

⌨️ 快捷键说明

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