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

📄 line.cpp

📁 MFC简易绘图
💻 CPP
字号:
// Line.cpp: implementation of the CLine class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "DrawSemple.h"
#include "Line.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
int CLine::Lcount=0;
//int CLine::Tflag=1;
CLine::CLine()
{

}

CLine::~CLine()
{

}

CLine::CLine(CPoint pt1,CPoint pt2,int stline,COLORREF linergb,COLORREF brushrgb
			 ):CTuyuan(pt1,pt2,stline,linergb,brushrgb)
{
	Tflagl=1;
}
void CLine::DrawTuyuan(CDC *pDC)      //声明绘制线段的成员函数
{
	CPen *pOldPen,*pNewPen;
	pDC->SetROP2(R2_NOTXORPEN);
	pNewPen=new CPen(PS_SOLID,styline,stylinergb);
	pOldPen = pDC->SelectObject(pNewPen);	
	pDC->MoveTo(m_pt1);
	pDC->LineTo(m_pt2);
	pDC->SelectObject(pOldPen);
	delete pNewPen;
	Lcount++;
	Tcount++;
}

IMPLEMENT_SERIAL(CLine,CObject,1)  //实现

void CLine::Serialize(CArchive &ar) //类CLine的序列化函数
{
	if(ar.IsStoring())
		ar<<m_pt1<<m_pt2;  //保存对象的数据
	else
		ar>>m_pt1>>m_pt2;  //读出对象数据
}



void CLine::BrushTuyuan(CDC *pDC)
{

}

int CLine::GetTflag()
{
	return 1;
}

⌨️ 快捷键说明

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