crect类里的left , top ,right , bottom分别是什么坐标?
来源:互联网 发布:为什么不读博 知乎 编辑:程序博客网 时间:2024/06/14 07:43
crect类里的left , top ,right , bottom分别是什么坐标?
//Microsoft Visual Studio/VC98/Include/wtypes.h中
typedef struct tagRECT
{
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;
//Microsoft Visual Studio/VC98/MFC/Include/afxwin.h中
class CRect : public tagRECT
{
public:
// Constructors
// uninitialized rectangle
CRect();
// from left, top, right, and bottom
CRect(int l, int t, int r, int b);
// copy constructor
CRect(const RECT& srcRect);
// from a pointer to another rect
CRect(LPCRECT lpSrcRect);
// from a point and size
CRect(POINT point, SIZE size);
// from two points
CRect(POINT topLeft, POINT bottomRight);
// Attributes (in addition to RECT members)
// retrieves the width
int Width() const;
// returns the height
int Height() const;
// returns the size
CSize Size() const;
// reference to the top-left point
CPoint& TopLeft();
// reference to the bottom-right point
CPoint& BottomRight();
// const reference to the top-left point
const CPoint& TopLeft() const;
// const reference to the bottom-right point
const CPoint& BottomRight() const;
// the geometric center point of the rectangle
CPoint CenterPoint() const;
// swap the left and right
void SwapLeftRight();
static void SwapLeftRight(LPRECT lpRect);
// convert between CRect and LPRECT/LPCRECT (no need for &)
operator LPRECT();
operator LPCRECT() const;
// returns TRUE if rectangle has no area
BOOL IsRectEmpty() const;
// returns TRUE if rectangle is at (0,0) and has no area
BOOL IsRectNull() const;
// returns TRUE if point is within rectangle
BOOL PtInRect(POINT point) const;
// Operations
// set rectangle from left, top, right, and bottom
void SetRect(int x1, int y1, int x2, int y2);
void SetRect(POINT topLeft, POINT bottomRight);
// empty the rectangle
void SetRectEmpty();
// copy from another rectangle
void CopyRect(LPCRECT lpSrcRect);
// TRUE if exactly the same as another rectangle
BOOL EqualRect(LPCRECT lpRect) const;
// inflate rectangle's width and height without
// moving its top or left
void InflateRect(int x, int y);
void InflateRect(SIZE size);
void InflateRect(LPCRECT lpRect);
void InflateRect(int l, int t, int r, int b);
// deflate the rectangle's width and height without
// moving its top or left
void DeflateRect(int x, int y);
void DeflateRect(SIZE size);
void DeflateRect(LPCRECT lpRect);
void DeflateRect(int l, int t, int r, int b);
// translate the rectangle by moving its top and left
void OffsetRect(int x, int y);
void OffsetRect(SIZE size);
void OffsetRect(POINT point);
void NormalizeRect();
// set this rectangle to intersection of two others
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2);
// set this rectangle to bounding union of two others
BOOL UnionRect(LPCRECT lpRect1, LPCRECT lpRect2);
// set this rectangle to minimum of two others
BOOL SubtractRect(LPCRECT lpRectSrc1, LPCRECT lpRectSrc2);
// Additional Operations
void operator=(const RECT& srcRect);
BOOL operator==(const RECT& rect) const;
BOOL operator!=(const RECT& rect) const;
void operator+=(POINT point);
void operator+=(SIZE size);
void operator+=(LPCRECT lpRect);
void operator-=(POINT point);
void operator-=(SIZE size);
void operator-=(LPCRECT lpRect);
void operator&=(const RECT& rect);
void operator|=(const RECT& rect);
// Operators returning CRect values
CRect operator+(POINT point) const;
CRect operator-(POINT point) const;
CRect operator+(LPCRECT lpRect) const;
CRect operator+(SIZE size) const;
CRect operator-(SIZE size) const;
CRect operator-(LPCRECT lpRect) const;
CRect operator&(const RECT& rect2) const;
CRect operator|(const RECT& rect2) const;
CRect MulDiv(int nMultiplier, int nDivisor) const;
};
可以搜索到具体的实现
<script type="text/javascript"><!--google_ad_client = "pub-0219395518240166";/* 728x90, 创建于 09-10-24 */google_ad_slot = "5564718531";google_ad_width = 728;google_ad_height = 90;// --></script>
- crect类里的left , top ,right , bottom分别是什么坐标?
- MFC中crect 中的left top right bottom释义
- margin: left right /top bottom的怪异
- View的位置--top, left, bottom, right
- css中absolute定位的top bottom left right
- css中的relative相对定位的top bottom left right
- 定位参数:position、left、right、top、bottom
- DIV CSS left right top bottom定位
- clip:rect('top', 'right', 'bottom', 'left')
- left right top bottom定位div无效
- DIV CSS left right top bottom定位
- glOrtho(left, right, bottom, top, near, far)
- css left right top bottom定位
- html中 left,right,top,bottom图示
- css属性left、right、top、bottom
- css之top,right,bottom,left
- setBounds(left, top, right, bottom)详解
- absolute同时设置left,right,top,bottom
- SelectObject和DeleteObject函数用法
- 解决MATLAB文件关联M等文件的问题
- CreatePen 用法
- 【转贴】ASP.Net 获取当前时间
- SetPixel用法
- crect类里的left , top ,right , bottom分别是什么坐标?
- COLORREF 的用法
- sendmessage的用法
- GetAsyncKeyState用法
- 【转贴】也谈 ASP.NET 1.1 中 QueryString 的安全获取写法
- SetTextColor() COLORREF SetBkColor SetBkMode的用法
- SQL With Ties 用法
- 关于HDC GetDC ReleaseDC
- peekmessage,getmessage区别浅入浅出