⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 line.cpp

📁 内容包括从VC++的基本范例到项目开发的许多典型的例子。是VC++初学者不可多得的好资料
💻 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 + -