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