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

📄 graphpoint.cpp

📁 一个简单的画图程序 可以画点线面等
💻 CPP
字号:
// GraphPoint.cpp: implementation of the CGraphPoint class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "SmallCAD203.h"
#include "GraphPoint.h"

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

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

CGraphPoint::CGraphPoint()
{
	nflag=2;
	x=0;
	y=0;

}

CGraphPoint::~CGraphPoint()
{

}

void CGraphPoint::SetLocation(int x, int y)
{
	this->x=x;
	this->y=y;

}

void CGraphPoint::SetLocation(CPoint point)
{
	x=point.x;
	y=point.y;

}

CPoint CGraphPoint::GetLocation()
{
	return CPoint(x,y);

}

void CGraphPoint::Draw(CDC *pDC)
{
	CPen pen;
	pen.CreatePen(PS_SOLID,1,m_color);
		pDC->SelectStockObject(NULL_BRUSH);
	pDC->SelectObject(&pen);
	pDC->Ellipse(x-m_scale,y-m_scale,x+m_scale,y+m_scale);
}


void CGraphPoint::Serialize(CArchive& ar)
{

	if(ar.IsStoring())
	{
		ar<<x<<y;
	}
	else
	{
		ar>>this->x>>this->y;
	}
}

⌨️ 快捷键说明

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