资源简介
按照以下作业要求制作1. 要求使用文档 / 视图模式开发。 2. 对于文档处理要求具有保存和打开功能,文件扩展名为 (.line) 。 3. 要求能处理三种图形的加载和保存工作,这三种图形分别为线、矩形和椭圆,并且能在视图中正确的显示出这些图形。(对于每一个图形除了有一些基本信息外,要能有颜色和线宽信息)

代码片段和文件信息
// Graph.cpp: implementation of the CGraph class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “Graphic.h“
#include “Graph.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CGraphCobject1)
CGraph::CGraph()
{
}
CGraph::CGraph(UINT m_nCurrentToolCPoint m_ptOriginCPoint m_ptEndUINT m_nLineWidthCOLORREF m_clr)
{
this->m_nCurrentTool=m_nCurrentTool;
this->m_ptOrigin=m_ptOrigin;
this->m_ptEnd=m_ptEnd;
this->m_nLineWidth=m_nLineWidth;
this->m_clr=m_clr;
}
CGraph::~CGraph()
{
}
void CGraph::Serialize(CArchive& ar)
{
if( ar.IsStoring() )
ar << m_nCurrentTool
<< m_ptOrigin
<< m_ptEnd
<< m_nLineWidth
<< m_clr;
else
ar >> m_nCurrentTool
>> m_ptOrigin
>> m_ptEnd
>> m_nLineWidth
>> m_clr;
}
void CGraph::Draw(CDC *pDC)
{
CBrush *pBrush=CBrush::FromHandle((HBRUSH)GetStockobject(NULL_BRUSH));
CBrush *pOldBrush=pDC->Selectobject(pBrush);
CPen pen(PS_SOLIDm_nLineWidthm_clr);
CPen *pOldPen=pDC->Selectobject(&pen);
switch(m_nCurrentTool)
{
case IDM_LINE:
pDC->MoveTo(m_ptOrigin);
pDC->LineTo(m_ptEnd);
break;
case IDM_Rectangle:
pDC->Rectangle(CRect(m_ptOriginm_ptEnd));
break;
case IDM_Ellipse:
pDC->Ellipse(CRect(m_ptOriginm_ptEnd));
break;
}
pDC->Selectobject(pOldBrush);
pDC->Selectobject(&pOldPen);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2757 2008-05-10 20:38 GraphicDoc.cpp
文件 1541 2008-05-10 20:38 GraphicDoc.h
文件 7558 2008-05-10 20:38 GraphicView.cpp
文件 2394 2008-05-10 20:38 GraphicView.h
文件 2508 2008-05-06 16:33 MainFrm.cpp
文件 1581 2008-05-06 16:33 MainFrm.h
文件 4335 2008-05-06 16:33 ReadMe.txt
文件 920 2008-05-07 23:10 resource.h
文件 977 2008-05-08 00:30 SettingDlg.cpp
文件 1229 2008-05-07 19:35 SettingDlg.h
文件 209 2008-05-06 16:33 StdAfx.cpp
文件 1054 2008-05-06 16:33 StdAfx.h
文件 1078 2008-05-06 16:33 res\Graphic.ico
文件 399 2008-05-06 16:33 res\Graphic.rc2
文件 1078 2008-05-06 16:33 res\GraphicDoc.ico
..A.SH. 6144 2008-05-08 16:48 res\Thumbs.db
文件 1678 2008-05-07 23:10 res\Toolbar.bmp
文件 1701 2008-05-10 15:47 Graph.cpp
文件 829 2008-05-10 13:41 Graph.h
文件 45444 2008-05-10 17:11 Graphic.aps
文件 3016 2008-05-10 20:39 Graphic.clw
文件 4227 2008-05-06 16:33 Graphic.cpp
文件 4827 2008-05-09 00:02 Graphic.dsp
文件 537 2008-05-07 00:24 Graphic.dsw
文件 127030 2008-05-10 20:38 Graphic.exe
文件 1367 2008-05-06 16:33 Graphic.h
文件 74752 2008-05-10 20:39 Graphic.ncb
文件 56832 2008-05-10 20:39 Graphic.opt
文件 248 2008-05-10 20:39 Graphic.plg
文件 13081 2008-05-10 17:11 Graphic.rc
............此处省略5个文件信息
相关资源
- DirectDraw 直接修改显存数据
-
Temporal-ba
sed Multi-Strokes Sketchy Graphi - Qt图片浏览器 --基于Qt的Graphics View f
- Mentor Graphics Expedition Enterprise v7.9.5.r
- Graphics Magic图像处理魔术师,含Delph
- Experiment investigation of deep-drawing sheet
- 兼容unity的System.Drawing.dll
- AnimatedVectorDrawable.
- QGraphicsView框架实现画板
- Coyote’s Guide To:Traditional IDL Graphics:U
- An introduction to probabilistic graphical mod
- EasyDraw软件
- iOS Drawing Practical UIKit Solutions 无水印
- The Magic of Computer Graphics 无水印pdf
- Mathematics for 3D Game Programming and Comput
- Mathematical Structures for Computer Graphics 无
- Interactive Computer Graphics(6th) 无水印
- Interactive Computer Graphics A Top-Down Appro
- 概率图模型Probabilistic Graphical Model论文
- 概率图模型Probabilistic Graphical Model论文
- tubedrawer.rar
- Edraw Max9.4破解版破解文件.rar254994
- Graphics Gems图形图像编程精粹所有源代
- Interactive Computer Graphics:A Top-Down App
- An introduction to probabilistic graphical mod
- Mentor Graphics Expedition PCB原版教程
- SmartDraw 2012-2013 破解补丁
- qdraw.zip
- atpdraw5.7安装软件
- Fluid Simulation for Computer Graphics Second
评论
共有 条评论