Click or drag to resize
Pdf Library for .NET

RectangleF Structure

Represents a rectangle defined by a single-precision floating-point location (top-left corner) and size (width and height), used throughout the SelectPdf public API.
Inheritance Hierarchy
SystemObject
  SystemValueType
    SelectPdf.Universal.DrawingRectangleF

Namespace: SelectPdf.Universal.Drawing
Assembly: SelectPdf.HtmlToPdf.Universal (in SelectPdf.HtmlToPdf.Universal.dll) Version: 26.4
Syntax
public struct RectangleF : IEquatable<RectangleF>

The RectangleF type exposes the following members.

Constructors
 NameDescription
Public methodRectangleF(PointF, Single, Single)Initializes a new rectangle from a location point and width/height.
Public methodRectangleF(Single, Single, Single, Single)Initializes a new rectangle with the specified location and size.
Top
Properties
 NameDescription
Public propertyBottomGets the Y coordinate of the bottom edge.
Public propertyHeightThe height of the rectangle.
Public propertyIsEmptyTrue if Width and Height are both zero.
Public propertyLeftGets the X coordinate of the left edge.
Public propertyLocationGets or sets the top-left corner of the rectangle.
Public propertyRightGets the X coordinate of the right edge.
Public propertyTopGets the Y coordinate of the top edge.
Public propertyWidthThe width of the rectangle.
Public propertyXThe X coordinate of the top-left corner.
Public propertyYThe Y coordinate of the top-left corner.
Top
Methods
 NameDescription
Public methodContains(PointF)Tests whether the specified point is contained within this rectangle.
Public methodContains(Single, Single)Tests whether the specified point is contained within this rectangle.
Public methodEquals(Object)Indicates whether this rectangle and the specified object have the same value.
(Overrides ValueTypeEquals(Object))
Public methodEquals(RectangleF)Indicates whether this rectangle and the specified RectangleF have the same location and size.
Public methodGetHashCodeReturns the hash code for this rectangle.
(Overrides ValueTypeGetHashCode)
Public methodToStringReturns a string representation of this RectangleF (its X, Y, Width and Height).
(Overrides ValueTypeToString)
Top
Operators
 NameDescription
Public operatorStatic memberEquality(RectangleF, RectangleF)Returns true if the two rectangles have identical location and size.
Public operatorStatic memberInequality(RectangleF, RectangleF)Returns true if the two rectangles differ in location or size.
Top
Fields
 NameDescription
Public fieldStatic memberEmptyRepresents a RectangleF with all components set to zero.
Top
Example
SelectPdf.Universal.Drawing.RectangleF rect =
    new SelectPdf.Universal.Drawing.RectangleF(10f, 20f, 200f, 80f);
float right = rect.Right;
bool inside = rect.Contains(50f, 40f);
See Also