ActionComponents  04.05.00
Customizable UI and time-saving tools for Android development with Xamarin and Visual Studio.
CoreGraphics.CGRect Class Reference

Represents a simulated iOS CGRect used to ease the porting of UI code from iOS to Android. A CGRect can be implicitly converted to and from an Android Rect or RectF. More...

Public Member Functions

 CGRect ()
 Initializes a new instance of the T:CoreGraphics.CGRect class. More...
 
 CGRect (CGRect rect)
 Initializes a new instance of the T:CoreGraphics.CGRect class. More...
 
 CGRect (CGPoint point, CGSize size)
 Initializes a new instance of the T:CoreGraphics.CGRect class. More...
 
 CGRect (int x, int y, int width, int height)
 Initializes a new instance of the T:CoreGraphics.CGRect class. More...
 
 CGRect (double x, double y, double width, double height)
 Initializes a new instance of the T:CoreGraphics.CGRect class. More...
 
 CGRect (nfloat x, nfloat y, nfloat width, nfloat height)
 Initializes a new instance of the T:CoreGraphics.CGRect class. More...
 
 CGRect (Rect rect)
 Initializes a new instance of the T:CoreGraphics.CGRect class. More...
 
 CGRect (RectF rect)
 Initializes a new instance of the T:CoreGraphics.CGRect class. More...
 
void Copy (CGRect rect)
 Copy the specified rect into this rect. More...
 
nfloat GetMinX ()
 Gets the minimum x. More...
 
nfloat GetMaxX ()
 Gets the max x. More...
 
nfloat GetMinY ()
 Gets the minimum y. More...
 
nfloat GetMaxY ()
 Gets the max y. More...
 
bool Contains (CGPoint point)
 Contains the specified point. More...
 
bool Contains (CGRect rect)
 Contains the specified rect. More...
 
bool Contains (int x, int y)
 Contains the specified x and y. More...
 
bool Contains (double x, double y)
 Contains the specified x and y. More...
 
bool Contains (nfloat x, nfloat y)
 Contains the specified x and y. More...
 
void Inflate (CGSize size)
 Increases the size of this CGRect. More...
 
void Inflate (int width, int height)
 Increases the size of this CGRect. More...
 
void Inflate (double width, double height)
 Increases the size of this CGRect. More...
 
void Inflate (nfloat width, nfloat height)
 Increases the size of this CGRect. More...
 
void Intersect (CGRect rect)
 Replaces this CGRect with the intersection of itself and the specified CGRect. More...
 
bool IntersectsWith (CGRect rect)
 Test to see if the given rectangle intersects with this rectangle. More...
 
void Offset (CGPoint point)
 Moves the location of this rectangle by the specified amount. More...
 
void Offset (int x, int y)
 Moves the location of this rectangle by the specified amount. More...
 
void Offset (double x, double y)
 Moves the location of this rectangle by the specified amount. More...
 
void Offset (nfloat x, nfloat y)
 Moves the location of this rectangle by the specified amount. More...
 
override string ToString ()
 Returns a T:System.String that represents the current T:CoreGraphics.CGRect. More...
 

Static Public Member Functions

static implicit operator Rect (CGRect rect)
 Converts the CGRect to a Rect. More...
 
static implicit operator CGRect (Rect rect)
 Converts the Rect to a CGRect. More...
 
static implicit operator RectF (CGRect rect)
 Converts the CGRect to a RectF. More...
 
static implicit operator CGRect (RectF rect)
 Converts the RectF to a CGRect. More...
 
static CGRect operator+ (CGRect a, CGRect b)
 Adds a CoreGraphics.CGRect to a CoreGraphics.CGRect, yielding a new T:CoreGraphics.CGRect. More...
 
static CGRect operator- (CGRect a, CGRect b)
 Subtracts a CoreGraphics.CGRect from a CoreGraphics.CGRect, yielding a new T:CoreGraphics.CGRect. More...
 
static bool operator== (CGRect a, CGRect b)
 Determines whether a specified instance of CoreGraphics.CGRect is equal to another specified CoreGraphics.CGRect. More...
 
static bool operator!= (CGRect a, CGRect b)
 Determines whether a specified instance of CoreGraphics.CGRect is not equal to another specified CoreGraphics.CGRect. More...
 
static bool operator< (CGRect a, CGRect b)
 Determines whether one specified CoreGraphics.CGRect is lower than another specfied CoreGraphics.CGRect. More...
 
static bool operator> (CGRect a, CGRect b)
 Determines whether one specified CoreGraphics.CGRect is greater than another specfied CoreGraphics.CGRect. More...
 
static bool operator<= (CGRect a, CGRect b)
 Determines whether one specified CoreGraphics.CGRect is lower than or equal to another specfied CoreGraphics.CGRect. More...
 
static bool operator>= (CGRect a, CGRect b)
 Determines whether one specified CoreGraphics.CGRect is greater than or equal to another specfied CoreGraphics.CGRect. More...
 
static CGRect FromLTRB (nfloat left, nfloat top, nfloat right, nfloat bottom)
 Creates a CGRect structure with the specified edge locations. More...
 
static CGRect Inflate (CGRect rect, nfloat width, nfloat height)
 Creates and returns an enlarged copy of the specified CGRect structure. The copy is enlarged by the specified amount. The original CGRect structure remains unmodified. More...
 
static CGRect Intersect (CGRect a, CGRect b)
 Returns a new CGRect representing the intersection of the two given rectangles. More...
 
static CGRect Union (CGRect a, CGRect b)
 Returns the union of the two rectangles More...
 

Properties

nfloat X [get, set]
 Gets or sets the x coordinate. More...
 
nfloat Y = 0f [get, set]
 Gets or sets the y coordinate. More...
 
nfloat Height = 0f [get, set]
 Gets or sets the height. More...
 
nfloat Width = 0f [get, set]
 Gets or sets the width. More...
 
nfloat Bottom = 0f [get]
 Gets the bottom. More...
 
nfloat Left [get]
 Gets the left. More...
 
CGPoint Location [get, set]
 Gets or sets the location. More...
 
nfloat Right [get]
 Gets the right. More...
 
CGSize Size [get, set]
 Gets or sets the size. More...
 
nfloat Top [get]
 Gets the top. More...
 

Detailed Description

Represents a simulated iOS CGRect used to ease the porting of UI code from iOS to Android. A CGRect can be implicitly converted to and from an Android Rect or RectF.

Constructor & Destructor Documentation

CoreGraphics.CGRect.CGRect ( )

Initializes a new instance of the T:CoreGraphics.CGRect class.

Here is the caller graph for this function:

CoreGraphics.CGRect.CGRect ( CGRect  rect)

Initializes a new instance of the T:CoreGraphics.CGRect class.

Parameters
rectRect.
CoreGraphics.CGRect.CGRect ( CGPoint  point,
CGSize  size 
)

Initializes a new instance of the T:CoreGraphics.CGRect class.

Parameters
pointPoint.
sizeSize.
CoreGraphics.CGRect.CGRect ( int  x,
int  y,
int  width,
int  height 
)

Initializes a new instance of the T:CoreGraphics.CGRect class.

Parameters
xThe x coordinate.
yThe y coordinate.
widthWidth.
heightHeight.
CoreGraphics.CGRect.CGRect ( double  x,
double  y,
double  width,
double  height 
)

Initializes a new instance of the T:CoreGraphics.CGRect class.

Parameters
xThe x coordinate.
yThe y coordinate.
widthWidth.
heightHeight.
CoreGraphics.CGRect.CGRect ( nfloat  x,
nfloat  y,
nfloat  width,
nfloat  height 
)

Initializes a new instance of the T:CoreGraphics.CGRect class.

Parameters
xThe x coordinate.
yThe y coordinate.
widthWidth.
heightHeight.
CoreGraphics.CGRect.CGRect ( Rect  rect)

Initializes a new instance of the T:CoreGraphics.CGRect class.

Parameters
rectRect.
CoreGraphics.CGRect.CGRect ( RectF  rect)

Initializes a new instance of the T:CoreGraphics.CGRect class.

Parameters
rectRect.

Member Function Documentation

bool CoreGraphics.CGRect.Contains ( CGPoint  point)

Contains the specified point.

Returns
true in the point is inside of the rect, else returns false.
Parameters
pointPoint.

Here is the caller graph for this function:

bool CoreGraphics.CGRect.Contains ( CGRect  rect)

Contains the specified rect.

Returns
true in the rect is inside of the rect, else returns false.
Parameters
rectRect.
bool CoreGraphics.CGRect.Contains ( int  x,
int  y 
)

Contains the specified x and y.

Returns
true in the x,y point is inside of the rect, else returns false.
Parameters
xThe x coordinate.
yThe y coordinate.
bool CoreGraphics.CGRect.Contains ( double  x,
double  y 
)

Contains the specified x and y.

Returns
true in the x,y point is inside of the rect, else returns false.
Parameters
xThe x coordinate.
yThe y coordinate.
bool CoreGraphics.CGRect.Contains ( nfloat  x,
nfloat  y 
)

Contains the specified x and y.

Returns
true in the x,y point is inside of the rect, else returns false.
Parameters
xThe x coordinate.
yThe y coordinate.
void CoreGraphics.CGRect.Copy ( CGRect  rect)

Copy the specified rect into this rect.

Parameters
rectRect.

Here is the caller graph for this function:

static CGRect CoreGraphics.CGRect.FromLTRB ( nfloat  left,
nfloat  top,
nfloat  right,
nfloat  bottom 
)
static

Creates a CGRect structure with the specified edge locations.

Returns
The new CGRect.
Parameters
leftLeft.
topTop.
rightRight.
bottomBottom.

Here is the call graph for this function:

nfloat CoreGraphics.CGRect.GetMaxX ( )

Gets the max x.

Returns
The max x.
nfloat CoreGraphics.CGRect.GetMaxY ( )

Gets the max y.

Returns
The max y.

Here is the caller graph for this function:

nfloat CoreGraphics.CGRect.GetMinX ( )

Gets the minimum x.

Returns
The minimum x.

Here is the caller graph for this function:

nfloat CoreGraphics.CGRect.GetMinY ( )

Gets the minimum y.

Returns
The minimum y.
static CGRect CoreGraphics.CGRect.Inflate ( CGRect  rect,
nfloat  width,
nfloat  height 
)
static

Creates and returns an enlarged copy of the specified CGRect structure. The copy is enlarged by the specified amount. The original CGRect structure remains unmodified.

Returns
The new CGRect.
Parameters
rectRect.
widthWidth.
heightHeight.

Here is the call graph for this function:

Here is the caller graph for this function:

void CoreGraphics.CGRect.Inflate ( CGSize  size)

Increases the size of this CGRect.

Parameters
sizeSize.
void CoreGraphics.CGRect.Inflate ( int  width,
int  height 
)

Increases the size of this CGRect.

Parameters
widthWidth.
heightHeight.
void CoreGraphics.CGRect.Inflate ( double  width,
double  height 
)

Increases the size of this CGRect.

Parameters
widthWidth.
heightHeight.
void CoreGraphics.CGRect.Inflate ( nfloat  width,
nfloat  height 
)

Increases the size of this CGRect.

Parameters
widthWidth.
heightHeight.
static CGRect CoreGraphics.CGRect.Intersect ( CGRect  a,
CGRect  b 
)
static

Returns a new CGRect representing the intersection of the two given rectangles.

Returns
The intersection as a new CGRect.
Parameters
aRect.
bRect.

Here is the call graph for this function:

void CoreGraphics.CGRect.Intersect ( CGRect  rect)

Replaces this CGRect with the intersection of itself and the specified CGRect.

Parameters
rectRect.

Here is the call graph for this function:

bool CoreGraphics.CGRect.IntersectsWith ( CGRect  rect)

Test to see if the given rectangle intersects with this rectangle.

Returns
true, if the rectangles intersect, false otherwise.
Parameters
rectRect.

Here is the caller graph for this function:

void CoreGraphics.CGRect.Offset ( CGPoint  point)

Moves the location of this rectangle by the specified amount.

Parameters
pointPoint.
void CoreGraphics.CGRect.Offset ( int  x,
int  y 
)

Moves the location of this rectangle by the specified amount.

Parameters
xThe x coordinate.
yThe y coordinate.
void CoreGraphics.CGRect.Offset ( double  x,
double  y 
)

Moves the location of this rectangle by the specified amount.

Parameters
xThe x coordinate.
yThe y coordinate.
void CoreGraphics.CGRect.Offset ( nfloat  x,
nfloat  y 
)

Moves the location of this rectangle by the specified amount.

Parameters
xThe x coordinate.
yThe y coordinate.
static implicit CoreGraphics.CGRect.operator CGRect ( Rect  rect)
static

Converts the Rect to a CGRect.

Returns
The implicitly converted CGRect.
Parameters
rectRect.

Here is the call graph for this function:

static implicit CoreGraphics.CGRect.operator CGRect ( RectF  rect)
static

Converts the RectF to a CGRect.

Returns
The implicitly converted CGRect.

Here is the call graph for this function:

static implicit CoreGraphics.CGRect.operator Rect ( CGRect  rect)
static

Converts the CGRect to a Rect.

Returns
The implicitly converted Rect.
Parameters
rectRect.
static implicit CoreGraphics.CGRect.operator RectF ( CGRect  rect)
static

Converts the CGRect to a RectF.

Returns
The implicitly converted RectF.
Parameters
rectRect.
static bool CoreGraphics.CGRect.operator!= ( CGRect  a,
CGRect  b 
)
static

Determines whether a specified instance of CoreGraphics.CGRect is not equal to another specified CoreGraphics.CGRect.

Parameters
aThe first CoreGraphics.CGRect to compare.
bThe second CoreGraphics.CGRect to compare.
Returns
true if a and b are not equal; otherwise, false.
static CGRect CoreGraphics.CGRect.operator+ ( CGRect  a,
CGRect  b 
)
static

Adds a CoreGraphics.CGRect to a CoreGraphics.CGRect, yielding a new T:CoreGraphics.CGRect.

Parameters
aThe first CoreGraphics.CGRect to add.
bThe second CoreGraphics.CGRect to add.
Returns
The T:CoreGraphics.CGRect that is the sum of the values of a and b.

Here is the call graph for this function:

static CGRect CoreGraphics.CGRect.operator- ( CGRect  a,
CGRect  b 
)
static

Subtracts a CoreGraphics.CGRect from a CoreGraphics.CGRect, yielding a new T:CoreGraphics.CGRect.

Parameters
aThe CoreGraphics.CGRect to subtract from (the minuend).
bThe CoreGraphics.CGRect to subtract (the subtrahend).
Returns
The T:CoreGraphics.CGRect that is the a minus b.

Here is the call graph for this function:

static bool CoreGraphics.CGRect.operator< ( CGRect  a,
CGRect  b 
)
static

Determines whether one specified CoreGraphics.CGRect is lower than another specfied CoreGraphics.CGRect.

Parameters
aThe first CoreGraphics.CGRect to compare.
bThe second CoreGraphics.CGRect to compare.
Returns
true if a is lower than b; otherwise, false.
static bool CoreGraphics.CGRect.operator<= ( CGRect  a,
CGRect  b 
)
static

Determines whether one specified CoreGraphics.CGRect is lower than or equal to another specfied CoreGraphics.CGRect.

Parameters
aThe first CoreGraphics.CGRect to compare.
bThe second CoreGraphics.CGRect to compare.
Returns
true if a is lower than or equal to b; otherwise, false.
static bool CoreGraphics.CGRect.operator== ( CGRect  a,
CGRect  b 
)
static

Determines whether a specified instance of CoreGraphics.CGRect is equal to another specified CoreGraphics.CGRect.

Parameters
aThe first CoreGraphics.CGRect to compare.
bThe second CoreGraphics.CGRect to compare.
Returns
true if a and b are equal; otherwise, false.
static bool CoreGraphics.CGRect.operator> ( CGRect  a,
CGRect  b 
)
static

Determines whether one specified CoreGraphics.CGRect is greater than another specfied CoreGraphics.CGRect.

Parameters
aThe first CoreGraphics.CGRect to compare.
bThe second CoreGraphics.CGRect to compare.
Returns
true if a is greater than b; otherwise, false.
static bool CoreGraphics.CGRect.operator>= ( CGRect  a,
CGRect  b 
)
static

Determines whether one specified CoreGraphics.CGRect is greater than or equal to another specfied CoreGraphics.CGRect.

Parameters
aThe first CoreGraphics.CGRect to compare.
bThe second CoreGraphics.CGRect to compare.
Returns
true if a is greater than or equal to b; otherwise, false.
override string CoreGraphics.CGRect.ToString ( )

Returns a T:System.String that represents the current T:CoreGraphics.CGRect.

Returns
A T:System.String that represents the current T:CoreGraphics.CGRect.
static CGRect CoreGraphics.CGRect.Union ( CGRect  a,
CGRect  b 
)
static

Returns the union of the two rectangles

Returns
The union.
Parameters
aRect.
bRect.

Here is the call graph for this function:

Property Documentation

nfloat CoreGraphics.CGRect.Bottom = 0f
get

Gets the bottom.

The bottom.

nfloat CoreGraphics.CGRect.Height = 0f
getset

Gets or sets the height.

The height.

nfloat CoreGraphics.CGRect.Left
get

Gets the left.

The left.

CGPoint CoreGraphics.CGRect.Location
getset

Gets or sets the location.

The location.

nfloat CoreGraphics.CGRect.Right
get

Gets the right.

The right.

CGSize CoreGraphics.CGRect.Size
getset

Gets or sets the size.

The size.

nfloat CoreGraphics.CGRect.Top
get

Gets the top.

The top.

nfloat CoreGraphics.CGRect.Width = 0f
getset

Gets or sets the width.

The width.

nfloat CoreGraphics.CGRect.X
getset

Gets or sets the x coordinate.

The x.

nfloat CoreGraphics.CGRect.Y = 0f
getset

Gets or sets the y coordinate.

The y.