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

📄 arc.cpp

📁 mfc实验例题也是高教得配套资料 刚找到得 这部分应该是自学的内容
💻 CPP
字号:
// Arc.cpp: implementation of the CCircle class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "exp22_1.h"
#include "Arc.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

IMPLEMENT_SERIAL(CCircle,CObject,1)

CCircle::CCircle():m_ptCenter(0,0)
{
	m_color = RGB(0,0,0);
	m_nRadius = 0;
}

CCircle::CCircle(int x,int y,int r):m_ptCenter(x,y)
{
	m_nRadius = r;
}

CCircle::~CCircle()
{

}

void CCircle::Serialize(CArchive& ar) 
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
		ar<<m_ptCenter<<m_nRadius<<m_color;
	}
	else
	{
		// TODO: add loading code here
		ar>>m_ptCenter>>m_nRadius>>m_color;
	}
}

void CCircle::Draw(CDC* pDC)
{
	CPen pen(PS_SOLID,0,m_color);
	CPen *oldPen;
	oldPen = pDC->SelectObject(&pen);

	CRect rect(m_ptCenter.x - m_nRadius,m_ptCenter.y - m_nRadius,m_ptCenter.x + m_nRadius,m_ptCenter.y + m_nRadius);
	pDC->Ellipse(&rect);
	pDC->SelectObject(oldPen);
}

⌨️ 快捷键说明

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