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

📄 mypoint.cpp

📁 快速凸包演示程序 演示了快速凸包算法的执行过程
💻 CPP
字号:
// MyPoint.cpp: implementation of the MyPoint class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "QuickHull.h"
#include "MyPoint.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

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


void MyPoint::blink(CDC *pDC) const
{
	const int d = 3;
	const int D = 6;
	HANDLE hBrush = CreateSolidBrush(color);
	//CPen* pLastPen;
	//pLastPen = pDC->SelectObject(GetStockObject(NULL_PEN));
	HANDLE lastPen = SelectObject(pDC->GetSafeHdc(), GetStockObject(NULL_PEN));
	pDC->SelectObject(GetStockObject(WHITE_BRUSH));
	pDC->Ellipse((int)(x) - d, (int)(y) - d, (int)(x) + d, (int)(y) + d);
	Sleep(200);
	pDC->SelectObject(hBrush);
	pDC->Ellipse((int)(x) - D, (int)(y) - D, (int)(x) + D, (int)(y) + D);
	Sleep(200);
	pDC->SelectObject(GetStockObject(WHITE_BRUSH));
	pDC->Ellipse((int)(x) - D, (int)(y) - D, (int)(x) + D, (int)(y) + D);
	Sleep(200);
	pDC->SelectObject(hBrush);
	pDC->Ellipse((int)(x) - d, (int)(y) - d, (int)(x) + d, (int)(y) + d);
	pDC->SelectObject(GetStockObject(WHITE_BRUSH));
	pDC->SelectObject(lastPen);

	DeleteObject(hBrush);
	
}

void MyPoint::Draw(CDC *pDC)
{
	const int d = 3;
	HANDLE hBrush = CreateSolidBrush(color);
	pDC->SelectObject(hBrush);
	pDC->Ellipse((int)(x) - d, (int)(y) - d, (int)(x) + d, (int)(y) + d);
	pDC->SelectObject(GetStockObject(WHITE_BRUSH));
	DeleteObject(hBrush);
}

⌨️ 快捷键说明

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