C# Class PixelFarm.Drawing.Rectangle

Mostrar archivo Open project: prepare/HTML-Renderer Class Usage Examples

Public Properties

Property Type Description
Empty Rectangle

Public Methods

Method Description
Ceiling ( RectangleF value ) : Rectangle

Ceiling Shared Method

Produces a Rectangle structure from a RectangleF structure by taking the ceiling of the X, Y, Width, and Height properties.

Contains ( Point pt ) : bool

Contains Method

Checks if a Point lies within this Rectangle.

Contains ( Rectangle rect ) : bool

Contains Method

Checks if a Rectangle lies entirely within this Rectangle.

Contains ( int x, int y ) : bool

Contains Method

Checks if an x,y coordinate lies within this Rectangle.

Equals ( object obj ) : bool

Equals Method

Checks equivalence of this Rectangle and another object.

FromLTRB ( int left, int top, int right, int bottom ) : Rectangle

FromLTRB Shared Method

Produces a Rectangle structure from left, top, right, and bottom coordinates.

GetHashCode ( ) : int

GetHashCode Method

Calculates a hashing value.

Inflate ( Rectangle rect, int x, int y ) : Rectangle

Inflate Shared Method

Produces a new Rectangle by inflating an existing Rectangle by the specified coordinate values.

Inflate ( Size size ) : void

Inflate Method

Inflates the Rectangle by a specified Size.

Inflate ( int width, int height ) : void

Inflate Method

Inflates the Rectangle by a specified width and height.

Intersect ( Rectangle a, Rectangle b ) : Rectangle

Intersect Shared Method

Produces a new Rectangle by intersecting 2 existing Rectangles. Returns null if there is no intersection.

Intersect ( Rectangle rect ) : void

Intersect Method

Replaces the Rectangle with the intersection of itself and another Rectangle.

IntersectsWith ( Rectangle rect ) : bool

IntersectsWith Method

Checks if a Rectangle intersects with this one.

IntersectsWith ( int left, int top, int right, int bottom ) : bool
Offset ( Point pos ) : void

Offset Method

Moves the Rectangle a specified distance.

Offset ( int x, int y ) : void

Offset Method

Moves the Rectangle a specified distance.

OffsetX ( int dx ) : void
OffsetY ( int dy ) : void
Rectangle ( Point location, Size size ) : System

Rectangle Constructor

Creates a Rectangle from Point and Size values.

Rectangle ( int x, int y, int width, int height ) : System

Rectangle Constructor

Creates a Rectangle from a specified x,y location and width and height values.

Round ( RectangleF value ) : Rectangle

Round Shared Method

Produces a Rectangle structure from a RectangleF by rounding the X, Y, Width, and Height properties.

ToString ( ) : string

ToString Method

Formats the Rectangle as a string in (x,y,w,h) notation.

Truncate ( RectangleF value ) : Rectangle
Union ( Rectangle a, Rectangle b ) : Rectangle

Union Shared Method

Produces a new Rectangle from the union of 2 existing Rectangles.

operator ( ) : bool

Equality Operator

Compares two Rectangle objects. The return value is based on the equivalence of the Location and Size properties of the two Rectangles.

Private Methods

Method Description
IntersectsWithInclusive ( Rectangle r ) : bool

Method Details

Ceiling() public static method

Ceiling Shared Method
Produces a Rectangle structure from a RectangleF structure by taking the ceiling of the X, Y, Width, and Height properties.
public static Ceiling ( RectangleF value ) : Rectangle
value RectangleF
return Rectangle

Contains() public method

Contains Method
Checks if a Point lies within this Rectangle.
public Contains ( Point pt ) : bool
pt Point
return bool

Contains() public method

Contains Method
Checks if a Rectangle lies entirely within this Rectangle.
public Contains ( Rectangle rect ) : bool
rect Rectangle
return bool

Contains() public method

Contains Method
Checks if an x,y coordinate lies within this Rectangle.
public Contains ( int x, int y ) : bool
x int
y int
return bool

Equals() public method

Equals Method
Checks equivalence of this Rectangle and another object.
public Equals ( object obj ) : bool
obj object
return bool

FromLTRB() public static method

FromLTRB Shared Method
Produces a Rectangle structure from left, top, right, and bottom coordinates.
public static FromLTRB ( int left, int top, int right, int bottom ) : Rectangle
left int
top int
right int
bottom int
return Rectangle

GetHashCode() public method

GetHashCode Method
Calculates a hashing value.
public GetHashCode ( ) : int
return int

Inflate() public static method

Inflate Shared Method
Produces a new Rectangle by inflating an existing Rectangle by the specified coordinate values.
public static Inflate ( Rectangle rect, int x, int y ) : Rectangle
rect Rectangle
x int
y int
return Rectangle

Inflate() public method

Inflate Method
Inflates the Rectangle by a specified Size.
public Inflate ( Size size ) : void
size Size
return void

Inflate() public method

Inflate Method
Inflates the Rectangle by a specified width and height.
public Inflate ( int width, int height ) : void
width int
height int
return void

Intersect() public static method

Intersect Shared Method
Produces a new Rectangle by intersecting 2 existing Rectangles. Returns null if there is no intersection.
public static Intersect ( Rectangle a, Rectangle b ) : Rectangle
a Rectangle
b Rectangle
return Rectangle

Intersect() public method

Intersect Method
Replaces the Rectangle with the intersection of itself and another Rectangle.
public Intersect ( Rectangle rect ) : void
rect Rectangle
return void

IntersectsWith() public method

IntersectsWith Method
Checks if a Rectangle intersects with this one.
public IntersectsWith ( Rectangle rect ) : bool
rect Rectangle
return bool

IntersectsWith() public method

public IntersectsWith ( int left, int top, int right, int bottom ) : bool
left int
top int
right int
bottom int
return bool

Offset() public method

Offset Method
Moves the Rectangle a specified distance.
public Offset ( Point pos ) : void
pos Point
return void

Offset() public method

Offset Method
Moves the Rectangle a specified distance.
public Offset ( int x, int y ) : void
x int
y int
return void

OffsetX() public method

public OffsetX ( int dx ) : void
dx int
return void

OffsetY() public method

public OffsetY ( int dy ) : void
dy int
return void

Rectangle() public method

Rectangle Constructor
Creates a Rectangle from Point and Size values.
public Rectangle ( Point location, Size size ) : System
location Point
size Size
return System

Rectangle() public method

Rectangle Constructor
Creates a Rectangle from a specified x,y location and width and height values.
public Rectangle ( int x, int y, int width, int height ) : System
x int
y int
width int
height int
return System

Round() public static method

Round Shared Method
Produces a Rectangle structure from a RectangleF by rounding the X, Y, Width, and Height properties.
public static Round ( RectangleF value ) : Rectangle
value RectangleF
return Rectangle

ToString() public method

ToString Method
Formats the Rectangle as a string in (x,y,w,h) notation.
public ToString ( ) : string
return string

Truncate() public static method

public static Truncate ( RectangleF value ) : Rectangle
value RectangleF
return Rectangle

Union() public static method

Union Shared Method
Produces a new Rectangle from the union of 2 existing Rectangles.
public static Union ( Rectangle a, Rectangle b ) : Rectangle
a Rectangle
b Rectangle
return Rectangle

operator() public static method

Equality Operator
Compares two Rectangle objects. The return value is based on the equivalence of the Location and Size properties of the two Rectangles.
public static operator ( ) : bool
return bool

Property Details

Empty public_oe static_oe property

Empty Shared Field
An uninitialized Rectangle Structure.
public static Rectangle,PixelFarm.Drawing Empty
return Rectangle