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

📄 fillpat.cpp

📁 一个复杂的画图系统
💻 CPP
字号:
// FillPat.cpp: implementation of the FillPat class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "geditor.h"
#include "FillPat.h"
#include "geditorView.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
FillPat::FillPat()
{

}

FillPat::FillPat(CPoint &pt,unsigned int color)
{
	fillpt=pt;
	m_color=color;
}

FillPat::~FillPat()
{

}


void FillPat::Draw(CDC *pDC)
{
	int oldROP2 = pDC->SetROP2(R2_COPYPEN);
	CBrush brush(m_color);
	CBrush* oldBrush = pDC->SelectObject(&brush);
	pDC->ExtFloodFill(fillpt.x, fillpt.y,pDC->GetPixel(fillpt),
		FLOODFILLSURFACE);
	pDC->SelectObject(oldBrush);
	pDC->SetROP2(oldROP2);
}

void FillPat::Serialize(CArchive &ar)
{
	CObject::Serialize(ar);
	if(ar.IsStoring())
	{
		ar<<m_color<<fillpt;
	}
	else
	{
		ar>>m_color>>fillpt;
	};
}

⌨️ 快捷键说明

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