📄 graphellipse.cpp
字号:
// GraphEllipse.cpp: implementation of the CGraphEllipse class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "smallcad203.h"
#include "GraphEllipse.h"
#include "iostream.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CGraphEllipse::CGraphEllipse():m_point1(0,0),m_point2(0,0)
{
nflag=1;
a=0;
}
CGraphEllipse::~CGraphEllipse()
{
}
void CGraphEllipse::SetPoint1(CPoint point)
{
m_point1=point;
}
CPoint CGraphEllipse::GetPoint1()
{
return m_point1;
}
void CGraphEllipse::SetPoint2(CPoint point)
{
m_point2=point;
}
CPoint CGraphEllipse::GetPoint2()
{
return m_point2;
}
void CGraphEllipse::Draw(CDC *pDC)
{
CPen pen;
pen.CreatePen(PS_SOLID,m_scale,m_color);
pDC->SelectStockObject(NULL_BRUSH);
pDC->SelectObject(&pen);
pDC->Ellipse(m_point1.x,m_point1.y,m_point2.x,m_point2.y);
}
void CGraphEllipse::Serialize(CArchive& ar)
{
if(ar.IsStoring())
{
ar<<this->m_point1<<this->m_point2;
}
else
{
ar>>this->m_point1>>this->m_point2;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -