Table of Contents

Struct PixelRect

Namespace
ScottPlot
Assembly
ScottPlot.dll
public readonly struct PixelRect : IEquatable<PixelRect>
Implements
Inherited Members
Extension Methods

Constructors

PixelRect(Pixel, Pixel)

Create a rectangle with edges at the given pixel positions. This constructor will rectify the points so rectangles will always have positive area.

public PixelRect(Pixel corner1, Pixel corner2)

Parameters

corner1 Pixel
corner2 Pixel

PixelRect(Pixel, PixelSize)

Create a rectangle representing pixels on a screen

public PixelRect(Pixel topLeftCorner, PixelSize size)

Parameters

topLeftCorner Pixel
size PixelSize

PixelRect(Pixel, float)

Create a rectangle from the bounding box of a circle centered at center with radius radius

public PixelRect(Pixel center, float radius)

Parameters

center Pixel
radius float

PixelRect(Pixel, float, float)

Create a rectangle representing pixels on a screen

public PixelRect(Pixel topLeftCorner, float width, float height)

Parameters

topLeftCorner Pixel
width float
height float

PixelRect(PixelOffset, PixelSize)

Create a rectangle representing pixels on a screen

public PixelRect(PixelOffset offset, PixelSize size)

Parameters

offset PixelOffset
size PixelSize

PixelRect(PixelRangeX, PixelRangeY)

Create a pixel rectangle from two pixel ranges

public PixelRect(PixelRangeX xRange, PixelRangeY yRange)

Parameters

xRange PixelRangeX
yRange PixelRangeY

PixelRect(PixelSize)

Create a rectangle representing pixels on a screen

public PixelRect(PixelSize size)

Parameters

size PixelSize

PixelRect(PixelSize, Pixel)

Create a rectangle representing pixels on a screen

public PixelRect(PixelSize size, Pixel offset)

Parameters

size PixelSize
offset Pixel

PixelRect(PixelSize, PixelOffset)

Create a rectangle representing pixels on a screen

public PixelRect(PixelSize size, PixelOffset offset)

Parameters

size PixelSize
offset PixelOffset

PixelRect(IEnumerable<Pixel>)

public PixelRect(IEnumerable<Pixel> pixels)

Parameters

pixels IEnumerable<Pixel>

PixelRect(float, float)

Create a rectangle representing pixels on a screen

public PixelRect(float width, float height)

Parameters

width float
height float

PixelRect(float, float, float, float)

Create a rectangle from the given edges. This constructor permits inverted rectangles with negative area.

public PixelRect(float left, float right, float bottom, float top)

Parameters

left float
right float
bottom float
top float

Fields

Bottom

public readonly float Bottom

Field Value

float

Left

public readonly float Left

Field Value

float

Right

public readonly float Right

Field Value

float

Top

public readonly float Top

Field Value

float

Properties

BottomCenter

public Pixel BottomCenter { get; }

Property Value

Pixel

BottomLeft

public Pixel BottomLeft { get; }

Property Value

Pixel

BottomLine

public PixelLine BottomLine { get; }

Property Value

PixelLine

BottomRight

public Pixel BottomRight { get; }

Property Value

Pixel

Center

public Pixel Center { get; }

Property Value

Pixel

HasArea

public bool HasArea { get; }

Property Value

bool

Height

public float Height { get; }

Property Value

float

HorizontalCenter

public float HorizontalCenter { get; }

Property Value

float

LeftCenter

public Pixel LeftCenter { get; }

Property Value

Pixel

LeftLine

public PixelLine LeftLine { get; }

Property Value

PixelLine

NaN

public static PixelRect NaN { get; }

Property Value

PixelRect

RightCenter

public Pixel RightCenter { get; }

Property Value

Pixel

RightLine

public PixelLine RightLine { get; }

Property Value

PixelLine

Size

public PixelSize Size { get; }

Property Value

PixelSize

TopCenter

public Pixel TopCenter { get; }

Property Value

Pixel

TopLeft

public Pixel TopLeft { get; }

Property Value

Pixel

TopLine

public PixelLine TopLine { get; }

Property Value

PixelLine

TopRight

public Pixel TopRight { get; }

Property Value

Pixel

VerticalCenter

public float VerticalCenter { get; }

Property Value

float

Width

public float Width { get; }

Property Value

float

Zero

public static PixelRect Zero { get; }

Property Value

PixelRect

Methods

AlignedInside(PixelRect, Alignment)

Return the position of this rectangle aligned inside a larger one

public PixelRect AlignedInside(PixelRect largerRect, Alignment alignment)

Parameters

largerRect PixelRect
alignment Alignment

Returns

PixelRect

AlignedInside(PixelRect, Alignment, PixelPadding)

Return the position of this rectangle aligned inside a larger one

public PixelRect AlignedInside(PixelRect largerRect, Alignment alignment, PixelPadding padding)

Parameters

largerRect PixelRect
alignment Alignment
padding PixelPadding

Returns

PixelRect

Contains(Pixel)

public bool Contains(Pixel px)

Parameters

px Pixel

Returns

bool

Contains(float, float)

public bool Contains(float x, float y)

Parameters

x float
y float

Returns

bool

ContainsX(float)

public bool ContainsX(float x)

Parameters

x float

Returns

bool

ContainsY(float)

public bool ContainsY(float y)

Parameters

y float

Returns

bool

Contract(PixelPadding)

public PixelRect Contract(PixelPadding padding)

Parameters

padding PixelPadding

Returns

PixelRect

Contract(float)

public PixelRect Contract(float delta)

Parameters

delta float

Returns

PixelRect

Contract(float, float)

public PixelRect Contract(float x, float y)

Parameters

x float
y float

Returns

PixelRect

Equals(PixelRect)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PixelRect other)

Parameters

other PixelRect

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Expand(PixelPadding)

public PixelRect Expand(PixelPadding pad)

Parameters

pad PixelPadding

Returns

PixelRect

Expand(PixelRect)

public PixelRect Expand(PixelRect other)

Parameters

other PixelRect

Returns

PixelRect

Expand(float)

public PixelRect Expand(float delta)

Parameters

delta float

Returns

PixelRect

ExpandX(float)

public PixelRect ExpandX(float x)

Parameters

x float

Returns

PixelRect

ExpandY(float)

public PixelRect ExpandY(float y)

Parameters

y float

Returns

PixelRect

Fraction(FractionRect)

public PixelRect Fraction(FractionRect frac)

Parameters

frac FractionRect

Returns

PixelRect

GetAlignedPixel(Alignment)

public Pixel GetAlignedPixel(Alignment alignment)

Parameters

alignment Alignment

Returns

Pixel

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Intersect(PixelRect)

Returns the intersection with another rectangle

public PixelRect Intersect(PixelRect other)

Parameters

other PixelRect

Other rectangle

Returns

PixelRect

Intersection rectangle

ToSKRect()

public SKRect ToSKRect()

Returns

SKRect

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

WithDelta(float, float)

public PixelRect WithDelta(float x, float y)

Parameters

x float
y float

Returns

PixelRect

WithDelta(float, float, Alignment)

public PixelRect WithDelta(float x, float y, Alignment alignment)

Parameters

x float
y float
alignment Alignment

Returns

PixelRect

WithOffset(PixelOffset)

public PixelRect WithOffset(PixelOffset offset)

Parameters

offset PixelOffset

Returns

PixelRect

WithPan(float, float)

public PixelRect WithPan(float x, float y)

Parameters

x float
y float

Returns

PixelRect

Operators

operator ==(PixelRect, PixelRect)

public static bool operator ==(PixelRect a, PixelRect b)

Parameters

a PixelRect
b PixelRect

Returns

bool

operator !=(PixelRect, PixelRect)

public static bool operator !=(PixelRect a, PixelRect b)

Parameters

a PixelRect
b PixelRect

Returns

bool