📄 line.cpp
字号:
// Line.cpp: implementation of the CLine class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MyDraw.h"
#include "Line.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//IMPLEMENT_DYNAMIC(CLine,CObject)
IMPLEMENT_SERIAL(CLine,CObject,1)
CLine::CLine()
{
bIsSelected=false;
startX=0;
startY=0;
endX=100;
endY=100;
LinePen.lopnWidth.x=3;
LinePen.lopnColor=RGB(0,0,0);
LinePen.lopnStyle=PS_SOLID;
}
CLine::~CLine()
{
}
void CLine::Serialize(CArchive & ar)
{
CObject::Serialize(ar);
if(ar.IsLoading())
{
ar>>startX>>startY>>endX>>endY>>LinePen.lopnWidth.x
>>LinePen.lopnColor>>LinePen.lopnStyle;
}
else
{
ar<<startX<<startY<<endX<<endY<<LinePen.lopnWidth.x
<<LinePen.lopnColor<<LinePen.lopnStyle;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -