line.cpp

来自「it s code MFC. i hope it will be usefull」· C++ 代码 · 共 43 行

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

#include "stdafx.h"
#include "MFC.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()
{
	m_pPen = NULL;
}

CLine::CLine(CPoint p1, CPoint p2, CPen *pPen)
{
	m_p1 = p1;
	m_p2 = p2;
	m_pPen = pPen;
}

void CLine::Draw(CDC *pDC)
{
	pDC->SelectObject(m_pPen);
	pDC->MoveTo(m_p1);
	pDC->LineTo(m_p2);

}

⌨️ 快捷键说明

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