Foxit PDF SDK
foxit.common.fxcrt.RectF Class Reference

Inherits SystemIDisposable.

Public Member Functions

 RectF ()
 Construct an empty rectangle.
 
 RectF (float left1, float bottom1, float right1, float top1)
 Construct a rectangle with left-bottom and right-top corners. More...
 
 RectF (RectI rect)
 Construct a rectangle with a rectangle object. More...
 
bool Contains (RectF other_rect)
 Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one. More...
 
bool Contains (float x, float y)
 Check if current rectangle fully contains the provided point. That means to check if the provided point is inside current rectangle. More...
 
void Deflate (float x, float y)
 Decreases the width and height of the rectangle. More...
 
void Deflate (float left, float bottom, float right, float top)
 Decreases the width and height of the rectangle. More...
 
void Deflate (RectF rt)
 Decreases the width and height of the rectangle. More...
 
RectI GetClosestRect ()
 Get a closest integer rectangle. More...
 
RectI GetInnerRect ()
 Convert to an inner integer rectangle. More...
 
RectI GetOutterRect ()
 Convert to an outer integer rectangle. More...
 
float Height ()
 Get the height of the rectangle. More...
 
void Inflate (float x, float y)
 Increases the width and height of the rectangle. More...
 
void Inflate (float left, float bottom, float right, float top)
 Increases the width and height of the rectangle. More...
 
void Inflate (RectF rt)
 Increases the width and height of the rectangle. More...
 
void InitRect (float x, float y)
 Initialize the rectangle to a single point. More...
 
void Intersect (RectF other_rect)
 Intersect with a rect. More...
 
bool IsEmpty ()
 Verify whether the rect is empty. More...
 
void Normalize ()
 Normalize the rect. Make sure left <= right, and bottom <= top. More...
 
void Reset ()
 Reset rectangle, set coordinates to 0. More...
 
void Transform (Matrix2D pMatrix)
 Transform a rectangle. The result rectangle is always normalized. More...
 
void Translate (float e, float f)
 Translate rectangle. More...
 
void Union (RectF other_rect)
 Union with a rect. More...
 
void UpdateRect (float x, float y)
 Update the rectangle to contain the specified point. More...
 
float Width ()
 Get the width of the rectangle. More...
 

Static Public Member Functions

static RectF GetBBox (PointF pPoints, int nPoints)
 Get the bounding box of input points array. More...
 

Properties

float bottom [get, set]
 The bottom.
 
float left [get, set]
 The left.
 
float right [get, set]
 The right.
 
float top [get, set]
 The top.
 

Detailed Description

A float-point coordination rectangle. A normalized float-point rectangle always has top larger than bottom, which is the opposite of Windows rectangle.

Constructor & Destructor Documentation

◆ RectF() [1/2]

foxit.common.fxcrt.RectF.RectF ( float  left1,
float  bottom1,
float  right1,
float  top1 
)
inline

Construct a rectangle with left-bottom and right-top corners.

Parameters
[in]left1The x-coordinate of the input left-bottom corner.
[in]bottom1The y-coordinate of the input left-bottom corner.
[in]right1The x-coordinate of the input right-top corner.
[in]top1The y-coordinate of the input right-top corner.

◆ RectF() [2/2]

foxit.common.fxcrt.RectF.RectF ( RectI  rect)
inline

Construct a rectangle with a rectangle object.

Parameters
[in]rectThe input rectangle object.

Member Function Documentation

◆ Contains() [1/2]

bool foxit.common.fxcrt.RectF.Contains ( RectF  other_rect)
inline

Check if current rectangle fully contains the other provided rectangle. That means to check if the other rectangle is fully inside current one.

Parameters
[in]other_rectThe other provided rect.
Returns
true means current rectangle fully contains the other one, while false means not.

◆ Contains() [2/2]

bool foxit.common.fxcrt.RectF.Contains ( float  x,
float  y 
)
inline

Check if current rectangle fully contains the provided point. That means to check if the provided point is inside current rectangle.

Parameters
[in]xThe x coordinate of the provided point.
[in]yThe y coordinate of the provided point.
Returns
true means current rectangle contains the provided point, while false means not.

◆ Deflate() [1/3]

void foxit.common.fxcrt.RectF.Deflate ( float  x,
float  y 
)
inline

Decreases the width and height of the rectangle.

Parameters
[in]xThe number to deflate the left and right of the rectangle.
[in]yThe number to deflate the top and bottom of the rectangle.
Returns
None.

◆ Deflate() [2/3]

void foxit.common.fxcrt.RectF.Deflate ( float  left,
float  bottom,
float  right,
float  top 
)
inline

Decreases the width and height of the rectangle.

Parameters
[in]leftThe number to deflate the left of the rectangle.
[in]bottomThe number to deflate the bottom of the rectangle.
[in]rightThe number to deflate the right of the rectangle.
[in]topThe number to deflate the top of the rectangle.
Returns
None.

◆ Deflate() [3/3]

void foxit.common.fxcrt.RectF.Deflate ( RectF  rt)
inline

Decreases the width and height of the rectangle.

Parameters
[in]rtThe rectangle to deflate each side.
Returns
None.

◆ GetBBox()

static RectF foxit.common.fxcrt.RectF.GetBBox ( PointF  pPoints,
int  nPoints 
)
inlinestatic

Get the bounding box of input points array.

Parameters
[in]pPointsThe input points array.
[in]nPointsThe number of points in the array.
Returns
A floating-point coordination rectangle.

◆ GetClosestRect()

RectI foxit.common.fxcrt.RectF.GetClosestRect ( )
inline

Get a closest integer rectangle.

Returns
The closest integer rectangle.

◆ GetInnerRect()

RectI foxit.common.fxcrt.RectF.GetInnerRect ( )
inline

Convert to an inner integer rectangle.

Returns
The inner integer rectangle.

◆ GetOutterRect()

RectI foxit.common.fxcrt.RectF.GetOutterRect ( )
inline

Convert to an outer integer rectangle.

Returns
The outer integer rectangle.

◆ Height()

float foxit.common.fxcrt.RectF.Height ( )
inline

Get the height of the rectangle.

Returns
Height of the rectangle.

◆ Inflate() [1/3]

void foxit.common.fxcrt.RectF.Inflate ( float  x,
float  y 
)
inline

Increases the width and height of the rectangle.

Parameters
[in]xThe number to inflate the left and right of the rectangle.
[in]yThe number to inflate the top and bottom of the rectangle.
Returns
None.

◆ Inflate() [2/3]

void foxit.common.fxcrt.RectF.Inflate ( float  left,
float  bottom,
float  right,
float  top 
)
inline

Increases the width and height of the rectangle.

Parameters
[in]leftThe number to inflate the left of the rectangle.
[in]bottomThe number to inflate the bottom of the rectangle.
[in]rightThe number to inflate the right of the rectangle.
[in]topThe number to inflate the top of the rectangle.
Returns
None.

◆ Inflate() [3/3]

void foxit.common.fxcrt.RectF.Inflate ( RectF  rt)
inline

Increases the width and height of the rectangle.

Parameters
[in]rtThe rectangle to inflate each side.
Returns
None.

◆ InitRect()

void foxit.common.fxcrt.RectF.InitRect ( float  x,
float  y 
)
inline

Initialize the rectangle to a single point.

Parameters
[in]xThe x-coordinate of the input point.
[in]yThe y-coordinate of the input point.
Returns
None.

◆ Intersect()

void foxit.common.fxcrt.RectF.Intersect ( RectF  other_rect)
inline

Intersect with a rect.

Parameters
[in]other_rectThe rect to intersect with.
Returns
None.

◆ IsEmpty()

bool foxit.common.fxcrt.RectF.IsEmpty ( )
inline

Verify whether the rect is empty.

Returns
true meanas current rect is empty, while false means not.

◆ Normalize()

void foxit.common.fxcrt.RectF.Normalize ( )
inline

Normalize the rect. Make sure left <= right, and bottom <= top.

Returns
None.

◆ Reset()

void foxit.common.fxcrt.RectF.Reset ( )
inline

Reset rectangle, set coordinates to 0.

Returns
None.

◆ Transform()

void foxit.common.fxcrt.RectF.Transform ( Matrix2D  pMatrix)
inline

Transform a rectangle. The result rectangle is always normalized.

Parameters
[in]pMatrixThe transformation matrix.
Returns
None.

◆ Translate()

void foxit.common.fxcrt.RectF.Translate ( float  e,
float  f 
)
inline

Translate rectangle.

Parameters
[in]eOffset in X-axis.
[in]fOffset in Y-axis.
Returns
None.

◆ Union()

void foxit.common.fxcrt.RectF.Union ( RectF  other_rect)
inline

Union with a rect.

Parameters
[in]other_rectThe rect to union with.
Returns
None.

◆ UpdateRect()

void foxit.common.fxcrt.RectF.UpdateRect ( float  x,
float  y 
)
inline

Update the rectangle to contain the specified point.

Parameters
[in]xThe x-coordinate of the input point.
[in]yThe y-coordinate of the input point.
Returns
None.

◆ Width()

float foxit.common.fxcrt.RectF.Width ( )
inline

Get the width of the rectangle.

Returns
Width of the rectangle.