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

📄 ellipse.cpp

📁 此源程序是一个简单的绘图程序,你通过他可以画一些简单的图形,是一款简单的画图程序,你通过他可是学到VC的图形编程.
💻 CPP
字号:
// Ellipse.cpp: implementation of the CEllipse class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MyDraw.h"
#include "Ellipse.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//IMPLEMENT_DYNAMIC(CEllipse,CObject)
IMPLEMENT_SERIAL(CEllipse,CObject,1)

CEllipse::CEllipse()
{
	bIsSelected=0;
	startX=0;
	startY=0;
	endX=100;
	endY=100;

	LinePen.lopnWidth.x=3;
	LinePen.lopnColor=RGB(0,0,0);
	LinePen.lopnStyle=PS_SOLID;

	MyBrush.lbColor=RGB(255,255,255);
	MyBrush.lbHatch=HS_CROSS;
	MyBrush.lbStyle=BS_NULL;
}

CEllipse::~CEllipse()
{

}

void CEllipse::Serialize(CArchive & ar)
{
	CObject::Serialize(ar);
    if(ar.IsLoading())
    {
		ar>>startX>>startY>>endX>>endY>>
			LinePen.lopnWidth.x>>LinePen.lopnColor>>LinePen.lopnStyle>>
			MyBrush.lbColor>>MyBrush.lbHatch>>MyBrush.lbStyle;  
    }
	else
	{
        ar<<startX<<startY<<endX<<endY<<LinePen.lopnWidth.x<<
			LinePen.lopnColor<<LinePen.lopnStyle<<
			MyBrush.lbColor<<MyBrush.lbHatch<<MyBrush.lbStyle;
    }
}

⌨️ 快捷键说明

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