Rectangle operations
[GDI functions]

Defines

Functions


Define Documentation

#define RECTH ( rc   )     ((rc).bottom - (rc).top)

Gets the height of a RECT object.

Definition at line 5407 of file gdi.h.

#define RECTHP ( prc   )     ((prc)->bottom - (prc)->top)

Gets the height of a RECT object by using the pointer to it.

Definition at line 5397 of file gdi.h.

#define RECTW ( rc   )     ((rc).right - (rc).left)

Gets the width of a RECT object.

Definition at line 5402 of file gdi.h.

#define RECTWP ( prc   )     ((prc)->right - (prc)->left)

Gets the width of a RECT object by using the pointer to it.

Definition at line 5392 of file gdi.h.


Function Documentation

void CopyRect ( RECT pdrc,
const RECT psrc 
) [inline, static]

Copies one rectangle to another.

This function copies the coordinates of the source rectangle pointed to by psrc to the destination rectangle pointed to by pdrc.

Parameters:
pdrc The pointer to the destination rectangle.
psrc The pointer to the source rectangle.
See also:
SetRect

Definition at line 5147 of file gdi.h.

BOOL GUIAPI DoesIntersect ( const RECT psrc1,
const RECT psrc2 
)

Determines whether two rectangles intersect.

This function determines whether two rectangles (psrc1 and psrc2) intersect.

Parameters:
psrc1 The first source rectangles.
psrc2 The second source rectangles.
Returns:
TRUE if the source rectangles intersect, otherwise FALSE.
See also:
IntersectRect
BOOL GUIAPI EqualRect ( const RECT prc1,
const RECT prc2 
)

Determines whether two rectangles are equal.

This function determines whether the two specified rectangles (prc1 and prc2) are equal by comparing the coordinates of the upper-left and lower-right corners.

Parameters:
prc1 The pointers to the first rectangles.
prc2 The pointers to the second rectangles.
Returns:
TRUE for equal, otherwise FALSE.
void GUIAPI GetBoundRect ( PRECT  pdrc,
const RECT psrc1,
const RECT psrc2 
)

Gets the bound rectangle of two source rectangles.

This function creates the bound rect (pdrc) of two rectangles (psrc1 and prsrc2). The bound rect is the smallest rectangle that contains both source rectangles.

Parameters:
pdrc The destination rectangle.
psrc1 The first source rectangle.
psrc2 The second source rectangle.
See also:
UnionRect
void InflateRect ( RECT prc,
int  cx,
int  cy 
) [inline, static]

Increases or decreases the width and height of an rectangle.

This function increases or decreases the width and height of the specified rectangle prc. This function adds cx units to the left and right ends of the rectangle and cy units to the top and bottom. the cx and cy are signed values; positive values increases the width and height, and negative values decreases them.

Parameters:
prc The pointer to the rectangle.
cx The inflating x value.
cy The inflating y value.
See also:
InflateRectToPt

Definition at line 5189 of file gdi.h.

void InflateRectToPt ( RECT prc,
int  x,
int  y 
) [inline, static]

Inflates a rectangle to contain a point.

This function inflates the rectangle prc to contain the specified point (x,y).

Parameters:
prc The pointer to the rectangle.
x x,y: The point.
y x,y: The point.
See also:
InflateRect

Definition at line 5208 of file gdi.h.

BOOL GUIAPI IntersectRect ( RECT pdrc,
const RECT psrc1,
const RECT psrc2 
)

Calculates the intersection of two rectangles.

This function calculates the intersection of two source rectangles (psrc1 and psrc2) and places the coordinates of the intersection rectangle into the destination rectangle pointed to by pdrc. If the source rectangles do not intersect, and empty rectangle (in which all coordinates are set to zero) is placed into the destination rectangle.

Parameters:
pdrc The pointer to the destination rectangle.
psrc1 The first source rectangles.
psrc2 The second source rectangles.
Returns:
TRUE if the source rectangles intersect, otherwise FALSE.
See also:
DoesIntersect, IsCovered
BOOL GUIAPI IsCovered ( const RECT prc1,
const RECT prc2 
)

Determines whether one rectangle is covered by another.

This function determines whether one rectangle (prc1) is covered by another rectangle (prc2).

Parameters:
prc1 The first rectangles.
prc2 The second rectangles.
Returns:
TRUE if the first rectangle is covered by the second, otherwise FALSE.
See also:
DoesIntersect
BOOL GUIAPI IsRectEmpty ( const RECT prc  ) 

Determines whether an rectangle is empty.

This function determines whether the specified rectangle prc is empty. An empty rectangle is one that has no area; that is, the coordinates of the right side is equal to the coordinate of the left side, or the coordinates of the bottom side is equal to the coordinate of the top side.

Parameters:
prc The pointer to the rectangle.
Returns:
TRUE for empty, otherwise FALSE.
void GUIAPI NormalizeRect ( RECT pRect  ) 

Normalizes a rectangle.

This function normalizes the rectangle pointed to by prc so that both the height and width are positive.

Parameters:
pRect The pointer to the rectangle.
void OffsetRect ( RECT prc,
int  x,
int  y 
) [inline, static]

Moves a rectangle by offsets.

This function moves the specified rectangle by the specified offsets. x and y specify the amount to move the rectangle left/right or up/down respectively. x must be a negative value to move the rectangle to the left, and y must be a negative value to move the rectangle up.

Parameters:
prc The pointer to the rectangle.
x The x offset.
y The y offset.
See also:
InflateRect

Definition at line 5168 of file gdi.h.

BOOL PtInRect ( const RECT prc,
int  x,
int  y 
) [inline, static]

Determines whether a point lies within an rectangle.

This function determines whether the specified point (x,y) lies within the specified rectangle prc.

A point is within a rectangle if it lies on the left or top side or is within all four sides. A point on the right or bottom side is considered outside the rectangle.

Parameters:
prc The pointer to the rectangle.
x x,y: The point.
y x,y: The point.

Definition at line 5231 of file gdi.h.

References FALSE, _RECT::left, _RECT::top, and TRUE.

void SetRect ( RECT prc,
int  left,
int  top,
int  right,
int  bottom 
) [inline, static]

Sets a rectangle.

This function sets the rectangle with specified values.

Parameters:
prc The pointer to the rectangle.
left The x coordinate of the upper-left corner of the rectangle.
top The y coordinate of the upper-left corner of the rectangle.
right The x coordinate of the lower-right corner of the rectangle.
bottom The y coordinate of the lower-right corner of the rectangle.
See also:
SetRectEmpty

Definition at line 5111 of file gdi.h.

void SetRectEmpty ( RECT prc  )  [inline, static]

Empties a rectangle.

This function empties the rectangle pointed to by prc. An empty rectangle in MiniGUI is a rectangle whose width and height both are zero. This function will sets all coordinates of the rectangle to be zero.

Parameters:
prc The pointer to the rectangle.
See also:
SetRect

Definition at line 5130 of file gdi.h.

int GUIAPI SubtractRect ( RECT rc,
const RECT psrc1,
const RECT psrc2 
)

Obtains the rectangles when substracting one rectangle from another.

This function obtains the rectangles substracting the rectangle psrc1 from the other psrc2. rc should be an array of RECT struct, and may contain at most four rectangles. This function returns the number of result rectangles.

Parameters:
rc The pointer to the resule rectangle array.
psrc1 The pointer to the minuend rectangle.
psrc2 The pointer to the subtrahend rectangle.
Returns:
The number of result rectangles.
See also:
UnionRect
BOOL GUIAPI UnionRect ( RECT pdrc,
const RECT psrc1,
const RECT psrc2 
)

Unions two source rectangles.

This function creates the union (pdrc) of two rectangles (psrc1 and psrc2), if the source rectangles are border upon and not stagger.

Parameters:
pdrc The unioned rectangle.
psrc1 The first source rectangles.
psrc2 The second source rectangles.
Returns:
TRUE if the source rectangles are border upon and not stagger, otherwise FALSE.
See also:
GetBoundRect
Generated on Thu Apr 7 15:58:38 2011 for MiniGUI V3.0.12 API Reference by  doxygen 1.6.3