📄 graphrectangle.cpp
字号:
// GraphRectangle.cpp: implementation of the CGraphRectangle class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "GraphRectangle.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CGraphRectangle::CGraphRectangle():m_point1(0,0),m_point2(0,0)
{
nflag=3;
a=0;
}
CGraphRectangle::~CGraphRectangle()
{
}
void CGraphRectangle::SetPoint1(CPoint point)
{
m_point1=point;
}
CPoint CGraphRectangle::GetPoint1()
{
return m_point1;
}
void CGraphRectangle::SetPoint2(CPoint point)
{
m_point2=point;
}
CPoint CGraphRectangle::GetPoint2()
{
return m_point2;
}
void CGraphRectangle::Draw(CDC *pDC)
{
CPen pen;
pen.CreatePen(PS_SOLID,m_scale,m_color);
pDC->SelectStockObject(NULL_BRUSH);
pDC->SelectObject(&pen);
pDC->Rectangle(m_point1.x,m_point1.y,m_point2.x,m_point2.y);
}
void CGraphRectangle::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 + -