//支持序列化类,必须继承自CObject类
class CShape :public CObject
{
public:
DECLARE_SERIAL(CShape)
CShape();
CShape(CPoint& BeginPoint,CPoint& EndPoint);
virtual void Draw(CDC* pDC){};
virtual void Serialize(CArchive& ar);
virtual ~CShape();
public:
//得到起点信息
CPoint GetBeginPoint() const
{ return m_Begin; }
//得到止点信息
CPoint GetEndPoint() const
{ return m_End; }
//得到笔颜色
COLORREF GetPenColor() const
{ return m_crPenColor; }
//得到笔宽度
int GetPenWidth() const
{ return m_nPenWidth; }
//设置笔信息
void SetPen( int nPenStyle, int nPenWidth, COLORREF crPenColor);
//设置起止点信息
void SetPoint(CPoint& BeginPoint,CPoint& EndPoint);
//设置刷子
virtual void SetBrush(COLORREF brushcolor){};
//取得名称
CString GetName()
{
return m_ShapeName;
}
protected:
//笔的信息
int m_nPenStyle;
int m_nPenWidth;
COLORREF m_crPenColor;
//起止点信息
CPoint m_Begin;
CPoint m_End;
//Name
CString m_ShapeName;
};