• 大小: 4.08MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-18
  • 语言: C/C++
  • 标签: MFC  

资源简介

可实现画矩形画圆等 同时可对其进行缩放平移

资源截图

代码片段和文件信息

// Circle.cpp: implementation of the CCircle class.
//
//////////////////////////////////////////////////////////////////////

#include “stdafx.h“
#include “InteractiveDraw.h“
#include “Circle.h“

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

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

CCircle::CCircle()
{

}

CCircle::~CCircle()
{

}
IMPLEMENT_SERIAL(CCircle CShape 1) 
CCircle::CCircle(CPoint pFP CPoint pSP int Width int style COLORREF Color int FFlag COLORREF FColor int HFlag int HPattern) 
{  
m_pFP=pFP; 
m_pSP=pSP; 
m_lineWidth=Width; 
m_linestyle=style; 
m_color=Color;  
m_FFlag=FFlag; 
m_FColor=FColor;  
m_HFlag=HFlag; 
m_HPattern=HPattern; 
}
void CCircle::Drawing(CDC *pDC) 
{  
CPen NewPen *pOldPen; 
NewPen.CreatePen(m_linestyle m_lineWidth m_color);  
pOldPen=pDC->Selectobject(&NewPen);  
pDC->SelectStockobject(NULL_BRUSH);  
CBrush NewBrush *pOldBrush;  
if(m_FFlag)  
{   
if(m_HFlag==0)    
NewBrush.CreateSolidBrush(m_FColor);  
else  
NewBrush.CreateHatchBrush(m_HPattern m_FColor); 
pOldBrush=pDC->Selectobject(&NewBrush); 

pDC->Ellipse(m_pFP.x m_pFP.y m_pSP.x m_pSP.y);  
pDC->Selectobject(pOldPen); 
if(m_FFlag) 
pDC->Selectobject(pOldBrush);
}
void CCircle::VCCircle(CDC *pDC) 

    CPen NewPen*pOldPen;  
NewPen.CreatePen(m_linestylem_lineWidthm_color);  
pOldPen=pDC->Selectobject(&NewPen);     
pDC->SelectStockobject(NULL_BRUSH);     
CBrush NewBrush*pOldBrush;     
if(m_FFlag)  
{   
if(m_HFlag==0)    
NewBrush.CreateSolidBrush(m_FColor); 
    else 
NewBrush.CreateHatchBrush(m_HPatternm_FColor);      
pOldBrush=pDC->Selectobject(&NewBrush); 
}   
pDC->Ellipse(m_pFP.xm_pFP.ym_pSP.xm_pSP.y); 
    pDC->Selectobject(pOldPen);     
if(m_FFlag) 
pDC->Selectobject(pOldBrush); 
}
void CCircle::Serialize(CArchive &ar) 
{  
if(ar.IsStoring())   
ar< else
ar>>m_pFP.x>>m_pFP.y>>m_pSP.x>>m_pSP.y>>m_FFlag>>m_color>>m_HFlag>>m_HPattern; 
CShape::Serialize(ar); 
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2329  2014-11-26 19:27  InteractiveDraw\InteractiveDraw\Circle.cpp

     文件        897  2014-11-26 19:27  InteractiveDraw\InteractiveDraw\Circle.h

     文件      23974  2014-11-26 19:27  InteractiveDraw\InteractiveDraw\Debug\Circle.obj

     文件      26241  2014-12-04 00:14  InteractiveDraw\InteractiveDraw\Debug\Ellipse.obj

     文件     143481  2014-12-04 13:16  InteractiveDraw\InteractiveDraw\Debug\InteractiveDraw.exe

     文件     737552  2014-12-04 13:16  InteractiveDraw\InteractiveDraw\Debug\InteractiveDraw.ilk

     文件      28013  2014-12-04 09:33  InteractiveDraw\InteractiveDraw\Debug\InteractiveDraw.obj

     文件    5489404  2014-12-04 00:14  InteractiveDraw\InteractiveDraw\Debug\InteractiveDraw.pch

     文件     566272  2014-12-04 13:16  InteractiveDraw\InteractiveDraw\Debug\InteractiveDraw.pdb

     文件       8060  2014-12-04 09:27  InteractiveDraw\InteractiveDraw\Debug\InteractiveDraw.res

     文件      41360  2014-12-04 00:14  InteractiveDraw\InteractiveDraw\Debug\InteractiveDrawDoc.obj

     文件      71419  2014-12-04 13:16  InteractiveDraw\InteractiveDraw\Debug\InteractiveDrawView.obj

     文件      26142  2014-12-04 00:14  InteractiveDraw\InteractiveDraw\Debug\Line.obj

     文件      22566  2014-12-04 00:14  InteractiveDraw\InteractiveDraw\Debug\MainFrm.obj

     文件      36750  2014-12-04 00:14  InteractiveDraw\InteractiveDraw\Debug\Rectangle.obj

     文件       7883  2014-12-04 00:14  InteractiveDraw\InteractiveDraw\Debug\Shape.obj

     文件     105926  2014-12-04 00:14  InteractiveDraw\InteractiveDraw\Debug\StdAfx.obj

     文件     230400  2014-12-04 13:16  InteractiveDraw\InteractiveDraw\Debug\vc60.idb

     文件     372736  2014-12-04 13:16  InteractiveDraw\InteractiveDraw\Debug\vc60.pdb

     文件        547  2014-11-27 19:20  InteractiveDraw\InteractiveDraw\Ellipse.cpp

     文件        536  2014-11-27 19:20  InteractiveDraw\InteractiveDraw\Ellipse.h

     文件      45632  2014-12-04 09:27  InteractiveDraw\InteractiveDraw\InteractiveDraw.aps

     文件       2610  2014-12-04 12:48  InteractiveDraw\InteractiveDraw\InteractiveDraw.clw

     文件       4371  2014-11-20 17:30  InteractiveDraw\InteractiveDraw\InteractiveDraw.cpp

     文件       5232  2014-11-27 09:28  InteractiveDraw\InteractiveDraw\InteractiveDraw.dsp

     文件        555  2014-11-20 17:30  InteractiveDraw\InteractiveDraw\InteractiveDraw.dsw

     文件       1455  2014-11-20 17:30  InteractiveDraw\InteractiveDraw\InteractiveDraw.h

     文件     279552  2014-12-04 13:27  InteractiveDraw\InteractiveDraw\InteractiveDraw.ncb

     文件      76800  2014-12-04 13:27  InteractiveDraw\InteractiveDraw\InteractiveDraw.opt

     文件       1561  2014-12-04 13:16  InteractiveDraw\InteractiveDraw\InteractiveDraw.plg

............此处省略87个文件信息

评论

共有 条评论