line.cpp

来自「这个是我们学校用的VC++教案」· C++ 代码 · 共 39 行

CPP
39
字号
// Line.cpp: implementation of the CLine class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MyDraw.h"
#include "Line.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CLine::CLine()
{

}

CLine::~CLine()
{

}

CLine::CLine(CPoint pt1,CPoint pt2)
{
	m_pt1=pt1;
	m_pt2=pt2;
}

void CLine::DrawLine(CDC* pDC)
{
	pDC->MoveTo(m_pt1);
	pDC->LineTo(m_pt2);
}

⌨️ 快捷键说明

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