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

📄 geopoint.cpp

📁 软件参考Windows操作系统下的画图程序
💻 CPP
字号:
// GeoPoint.cpp: implementation of the GeoPoint class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Drawing.h"
#include "GeoPoint.h"

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

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

GeoPoint::GeoPoint()
{
	m_pPoint.x = m_pPoint.y = 0;
}

GeoPoint::~GeoPoint()
{

}

void GeoPoint::Draw(CDC &dc)
{
	//为了实现点的任意大小绘制,采用画圆的方法绘制点,即以该点为中心,width为半径作圆
	CPen pen(PS_SOLID, m_nWidth, m_color);
	CPen *oldpen = dc.SelectObject(&pen);
	CBrush bru(m_color);
	CBrush *oldbru = dc.SelectObject(&bru);	
	dc.Ellipse(m_pPoint.x-m_nWidth, m_pPoint.y-m_nWidth, m_pPoint.x+m_nWidth, m_pPoint.y+m_nWidth);
	dc.SelectObject(oldpen);
	dc.SelectObject(oldbru);
}

⌨️ 快捷键说明

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