?? line.cpp
字號:
// Line.cpp: implementation of the CLine class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Ex07_2.h"
#include "Line.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
IMPLEMENT_SERIAL(CLine,CObject,1)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CLine::CLine()
{
m_StartPt.x=0;
m_StartPt.y=0;
m_EndPt.x=0;
m_EndPt.y=0;
}
CLine::CLine(int x1,int y1,int x2,int y2)
{
m_StartPt.x=x1;
m_StartPt.y=y1;
m_EndPt.x=x2;
m_EndPt.y=y2;
}
CLine::CLine(CPoint pt1,CPoint pt2)
{
m_StartPt=pt1;
m_EndPt=pt2;
}
CLine::~CLine()
{
}
void CLine::Draw(CDC*pDC)
{
pDC->MoveTo(m_StartPt);
pDC->LineTo(m_EndPt);
}
void CLine::Serialize(CArchive&ar)
{
if(ar.IsStoring())
ar<<m_StartPt<<m_EndPt;
else
ar>>m_StartPt>>m_EndPt;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -