📄 line.cpp
字号:
// Line.cpp: implementation of the CLine class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Draw.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 ptFrom, CPoint ptTo,COLORREF crColor)
{
m_ptFrom=ptFrom;
m_ptTo=ptTo;
m_crColor=crColor;
}
void CLine::Draw(CDC *PDC)
{
CPen lpen(PS_SOLID,1,m_crColor);
CPen* pOldPen=PDC->SelectObject(&lpen);
PDC->MoveTo(m_ptFrom);
PDC->LineTo(m_ptTo);
PDC->SelectObject(pOldPen);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -