MyDraw.h
上传用户:netltd
上传日期:2013-02-12
资源大小:7234k
文件大小:2k
- //绘制直线、矩形、圆等图形对象,应该与图形对象的具体数据结构无关
- class CDrawGrapObject : public CObject
- {
- public:
- CDrawGrapObject();
- void Initialize();
- void SetOnceFlag();
- private:
- BOOL OnceFlag;
- public:
- //绘图时基于CDC, (0,0)点为窗口区的左上角
- //绘制直线
- void DrawLineXOR(CDC* pDC, POINT StartPoint, POINT EndPoint, POINT oldEndPoint); //用异或擦除旧的直线,并用异或绘制新的直线
- void DrawLine(CDC* pDC, POINT StartPoint, POINT EndPoint, int LineStyle, COLORREF PenColor); //直接绘制新的直线
- void CancelDrawLine(CDC* pDC, POINT StartPoint, POINT EndPoint); //用异或擦除旧的直线
- void DrawSelLine(CDC* pDC, POINT StartPoint, POINT EndPoint, int LineStyle, COLORREF PenColor);
-
- public:
- //绘制矩形
- void DrawRectXOR(CDC* pDC, POINT StartPoint, POINT EndPoint, POINT oldEndPoint);
- void DrawRect(CDC* pDC, POINT StartPoint, POINT EndPoint, int LineStyle, COLORREF PenColor);
- void CancelDrawRect(CDC* pDC, POINT StartPoint, POINT EndPoint);
- void DrawSelRect(CDC* pDC, POINT StartPoint, POINT EndPoint, int Style, COLORREF Color);
- public:
- //绘制圆
- void DrawCircleXOR(CDC* pDC, POINT StartPoint, POINT EndPoint, POINT oldEndPoint);
- void DrawCircle(CDC* pDC, POINT StartPoint, POINT EndPoint, int LineStyle, COLORREF PenColor);
- void DrawCircle(CDC* pDC, POINT StartPoint, long Radius, int LineStyle, COLORREF PenColor);
- void CancelDrawCircle(CDC* pDC, POINT StartPoint, POINT EndPoint);
- void DrawSelCircle(CDC* pDC, POINT StartPoint, long Radius, int Style, COLORREF Color);
-
- public:
- //绘制圆弧
- void DrawArcXOR(CDC* pDC, POINT StartPoint, POINT MidPoint, POINT oldMidPoint,
- POINT EndPoint, POINT oldEndPoint, int times);
- void DrawArc(CDC* pDC, POINT StartPoint, POINT MidPoint, POINT EndPoint, int LineStyle,
- COLORREF PenColor);
- void DrawArc(CDC* pDC, POINT OriginPoint, POINT StartPoint, POINT EndPoint, long Radius,
- int LineStyle, COLORREF PenColor);
- void CancelDrawArc(CDC* pDC, POINT StartPoint, POINT MidPoint, POINT EndPoint, int times);
- void DrawSelArc(CDC* pDC, POINT OriginPoint, POINT StartPoint, POINT EndPoint,
- long Radius, int LineStyle, COLORREF PenColor);
- };