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

📄 drawcircle_origin.cpp

📁 此为本书的配套光盘.本书不但由浅入深地讲解了软件保护技术
💻 CPP
字号:

#include "stdafx.h"
#include "DrawCircle.h"

#include "DrawCircleDoc.h"
#include "DrawCircleView.h"
#include "DrawParamDlg.h"
#include "DrawMethodDlg.h"

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

void CDrawCircleView::DrawCircleMidPoint(CDC *pDC, int iCenterX, int iCenterY, int r)
{
	int x=0;
	int y=r;
	int p=1-r;

	TRACE("Origin\n");

	CirclePlotPoints(pDC,iCenterX,iCenterY,x,y);
	
	m_lpCircleBuf[0].x = x;
	m_lpCircleBuf[0].y = y;
	m_nPointCount=1;

	while(x<y)
	{
		x++;
		if(p<0)
		{
			p+=2*x+1;			
		}		
		else
		{
			y--;
			p+=2*(x-y)+1;			
		}		
		TRACE("%d,(%d,%d);",p,x,y);
		CirclePlotPoints(pDC,iCenterX,iCenterY,x,y);

		m_lpCircleBuf[m_nPointCount].x = x;
		m_lpCircleBuf[m_nPointCount].y = y;
		m_nPointCount++;
	}
	TRACE("\n");
}

⌨️ 快捷键说明

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