FlRect.h
资源名称:44757463.rar [点击查看]
上传用户:lj3531212
上传日期:2007-06-18
资源大小:346k
文件大小:1k
源码类别:
绘图程序
开发平台:
Visual C++
- // FlRect.h: interface for the CFlRect class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_FLRECT_H__78B6D2DC_E7AE_40EF_AF2D_933289BEB4C2__INCLUDED_)
- #define AFX_FLRECT_H__78B6D2DC_E7AE_40EF_AF2D_933289BEB4C2__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- //////////////////////////////////////////////////////////////////////
- // CLASS :CFlRect
- // ABSTRACT :为了减少误差,用符点型取代整型的矩形
- // NOTE :
- // CREATE :FNST)XiaGongLi 2004-5-14
- // UPDATE :
- // :
- //////////////////////////////////////////////////////////////////////
- class CFlRect
- {
- public:
- CFlRect();
- CFlRect(CRect rect);
- CFlRect(CPoint topLeft,CPoint bottomRight);
- CFlRect(float lf,float tp,float rt,float bm);
- virtual ~CFlRect();
- public:
- //attributes
- float left;
- float top;
- float right;
- float bottom;
- public:
- //operation
- CRect GetRect();
- void OffsetRect(float cx,float cy);
- CPoint LeftTop();
- CPoint BottomRight();
- CPoint CenterPoint();
- float Width();
- float Height();
- bool PtInRect(CPoint pt);
- bool PtInRect(float x,float y);
- void InflateRect(float cx,float cy);
- void DeflateRect(float cx,float cy);
- void NormalizeRect();
- friend bool operator !=(CFlRect& rtA,CFlRect& rtB);
- operator CRect( );
- };
- #endif // !defined(AFX_FLRECT_H__78B6D2DC_E7AE_40EF_AF2D_933289BEB4C2__INCLUDED_)