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

📄 myrect.cpp

📁 绘制各种图形的类
💻 CPP
字号:
// Rect.cpp: implementation of the CRect class.
//
//////////////////////////////////////////////////////////////////////

#include "myRect.h"

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

CRect::CRect()
{

}

CRect::~CRect()
{

}

boolean CRect::draw(IGraphics *pg)
{
	boolean rval;
	AEERect r;
	r.x = m_ulc.getx();
	r.y = m_ulc.gety();
	r.dx = m_lrc.getx() - r.x;
	r.dy = m_lrc.gety() - r.y;
	rval = (IGRAPHICS_DrawRect(pg, &r) == SUCCESS);
	return rval;
}

CRect::CRect(int16 x, int16 y, int16 dx, int16 dy, RGBVAL col): CShape(CColor(col)), 
																		m_ulc(x,y), m_lrc(x+dx, y+dy)
{
}

CRect::CRect(CPoint ulc, CPoint lrc, RGBVAL col): CShape(CColor(col)), m_ulc(ulc), m_lrc(lrc)
{

}

void* CRect::operator new(size_t sz)
{
	return MALLOC(sz);
}

void CRect::operator delete(void *p)
{
	FREE(p);
}

⌨️ 快捷键说明

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