DrawShape.cpp
资源名称:DrawSys.zip [点击查看]
上传用户:mosfetic
上传日期:2022-06-16
资源大小:4612k
文件大小:1k
源码类别:
GDI/图象编程
开发平台:
Visual C++
- // DrawShape.cpp: implementation of the CDrawShape class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "DrawSys.h"
- #include "DrawShape.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- IMPLEMENT_SERIAL(CDrawShape, CObject, 1)
- CDrawShape::CDrawShape()
- {
- }
- CDrawShape::~CDrawShape()
- {
- }
- void CDrawShape::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- // TODO: add storing code here
- ar << m_tmCreate << m_iID;
- }
- else
- {
- // TODO: add loading code here
- ar >> m_tmCreate >> m_iID;
- }
- }
- void CDrawShape::MyFormatString(CString& strText, int i)
- {
- strText.Empty();
- if(i < 10)
- {
- strText.Format("00%d#", i);
- }
- else if(i < 100)
- {
- strText.Format("0%d#", i);
- }
- else
- {
- strText.Format("%d#", i);
- }
- }
- LONG CDrawShape::MIN(LONG num1, LONG num2)
- {
- if(num1 > num2)
- return num2;
- return num1;
- }
- LONG CDrawShape::MAX(LONG num1, LONG num2)
- {
- if(num1 > num2)
- return num1;
- return num2;
- }