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

📄 line.cpp

📁 画简单的图形用VC++开发的利用鼠标响应程序的实行
💻 CPP
字号:
// Line.cpp: implementation of the CLine class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "画图.h"
#include "Line.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CLine,CObject,1)
CLine::CLine()
{
	start=end=CPoint(0,0);
	width=1;
	color=RGB(0,0,255);

}

CLine::~CLine()
{

}

CLine::CLine(CPoint p1, CPoint p2, int w,COLORREF c)
{
	start=p1;
	end=p2;
	width=2;
	color=c;
}

void CLine::Serialize(CArchive &ar)
{
	if(ar.IsStoring())
		ar<<start<<end<<width<<color;
	else
		ar>>start>>end>>width>>color;
}

CPoint CLine::GetStart()
{
	return start;
}


CPoint CLine::GetEnd()
{
	return end;
}

void CLine::SetStart(CPoint p)
{
	start=p;
}

void CLine::SetEnd(CPoint p)
{
	end=p;

}

void CLine::SetWidth(int w)
{
	width=w;
}

int CLine::GetWidth()
{
	return width;

}

COLORREF CLine::GetColor()
{
	return color;
}

void CLine::SetColor(COLORREF c)
{
	color=c;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -