erect.cpp
来自「mfc的电子元器件系统。可以绘制基本图形。对cdc的初级应用。」· C++ 代码 · 共 56 行
CPP
56 行
// Erect.cpp: implementation of the CErect class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Maze.h"
#include "Erect.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CErect,CShape,0)
CErect::CErect()
{
}
CErect::~CErect()
{
}
CErect::CErect(CRect rect):CShape(rect)
{
}
void CErect::Serialize(CArchive &ar)
{
CShape::Serialize(ar);
}
void CErect::Draw(CDC *pDC)
{
CShape::Draw(pDC);
CPen* OldPen;
CPen* NewPen=new CPen(PS_SOLID,4,RGB(255,0,200));
OldPen=pDC->SelectObject(NewPen);
CRect rect;
rect=GetRectTracker();
// pDC->MoveTo(rect.left,(rect.top+rect.bottom)/2);
// pDC->LineTo(rect.right,(rect.top+rect.bottom)/2);
pDC->MoveTo((rect.left+rect.right)/2,rect.top);
pDC->LineTo((rect.left+rect.right)/2,rect.bottom);
pDC->SelectObject(OldPen);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?