SkiaSharp.SKRect Structure

Stores a set of four floating-point numbers that represent the upper-left corner and lower-right corner of a rectangle.

See Also: SKRect

Syntax

public struct SKRect

Remarks

Requirements

Namespace: SkiaSharp
Assembly: SkiaSharp (in SkiaSharp.dll)
Assembly Versions: 1.0.0.0, 1.49.0.0, 1.52.0.0, 1.53.0.0, 1.54.0.0, 1.54.0.0, 1.55.0.0, 1.56.0.0, 1.57.0.0, 1.58.0.0, 1.59.0.0

The members of SkiaSharp.SKRect are listed below.

See Also: ValueType

Public Constructors

Initializes a new instance of the SKRect class with the specified upper-left corner and lower-right corner.

Public Fields

static readonly
EmptySKRect. Represents a new instance of the SKRect class with member data left uninitialized.

Public Properties

BottomSingle. Gets or sets the y-coordinate of the bottom edge of this SKRect structure.
[read-only]
HeightSingle. Gets the height of the SKRect.
[read-only]
IsEmptyBoolean. Gets a value indicating whether this rectangle has a zero size and location.
LeftSingle. Gets or sets the x-coordinate of the left edge of this SKRect structure.
LocationSKPoint. Gets or sets the offset of the rectangle.
[read-only]
MidXSingle. Gets the x-coordinate of the middle of this rectangle.
[read-only]
MidYSingle. Gets the y-coordinate of the middle of this rectangle.
RightSingle. Gets or sets the x-coordinate of the right edge of this SKRect structure.
SizeSKSize. Gets or sets the size of the rectangle.
[read-only]
StandardizedSKRect. Gets this rectangle and a new rectangle with a positive width and height.
TopSingle. Gets or sets the y-coordinate of the top edge of this SKRect structure.
[read-only]
WidthSingle. Gets the width of the rectangle.

Public Methods

AspectFill(SKSize) : SKRect
Calculates the smallest rectangle that will fill the current rectangle using the specified size.
AspectFit(SKSize) : SKRect
Calculates the largest rectangle that will fit inside the current rectangle using the specified size.
Contains(SKPoint) : Boolean
Determines whether the specified point is inside this rectangle.
Contains(SKRect) : Boolean
Determines whether the specified rectangle is inside this rectangle.
Contains(Single, Single) : Boolean
Determines whether the specified coordinates are inside this rectangle.
static
Create(SKSize) : SKRect
Creates a new rectangle with the specified size.
static
Create(SKPoint, SKSize) : SKRect
Creates a new rectangle with the specified location and size.
static
Create(Single, Single) : SKRect
Creates a new rectangle with the specified size.
static
Create(Single, Single, Single, Single) : SKRect
Creates a new rectangle with the specified location and size.
override
Equals(Object) : Boolean
Specifies whether this rectangle contains the same coordinates as the specified Object.
override
GetHashCode() : Int32
Calculates the hashcode for this rectangle.
Inflate(SKSize)
Enlarges this SKRect structure by the specified amount.
Inflate(Single, Single)
Enlarges this SKRect structure by the specified amount.
static
Inflate(SKRect, Single, Single) : SKRect
Creates and returns an enlarged copy of the specified SKRect structure. The copy is enlarged by the specified amount and the original rectangle remains unmodified.
Intersect(SKRect)
Replaces this SKRect structure with the intersection of itself and the specified SKRect structure.
static
Intersect(SKRect, SKRect) : SKRect
Returns a SKRect structure that represents the intersection of two rectangles. If there is no intersection, and empty SKRect is returned.
IntersectsWith(SKRect) : Boolean
Determines if this rectangle intersects with another rectangle.
IntersectsWithInclusive(SKRect) : Boolean
Determines if this rectangle intersects with another rectangle.
Offset(SKPoint)
Translates the this rectangle by the specified amount.
Offset(Single, Single)
Translates the this rectangle by the specified amount.
override
ToString() : String
Converts this SKRect to a human readable string.
Union(SKRect)
Replaces this SKRect structure with the union of itself and the specified SKRect structure.
static
Union(SKRect, SKRect) : SKRect
Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.

Public Operators

static
Equality(SKRect, SKRect)Tests whether two SKRect structures have equal coordinates.
static
Inequality(SKRect, SKRect)Tests whether two SKRect structures differ in coordinates.
static
Conversion to SkiaSharp.SKRect(Implicit)Converts the specified SKRectI structure to a SKRect structure.