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
PixelRect(Pixel, PixelSize)
Create a rectangle representing pixels on a screen
public PixelRect(Pixel topLeftCorner, PixelSize size)
Parameters
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
PixelRect(Pixel, float, float)
Create a rectangle representing pixels on a screen
public PixelRect(Pixel topLeftCorner, float width, float height)
Parameters
PixelRect(PixelOffset, PixelSize)
Create a rectangle representing pixels on a screen
public PixelRect(PixelOffset offset, PixelSize size)
Parameters
offsetPixelOffsetsizePixelSize
PixelRect(PixelRangeX, PixelRangeY)
Create a pixel rectangle from two pixel ranges
public PixelRect(PixelRangeX xRange, PixelRangeY yRange)
Parameters
xRangePixelRangeXyRangePixelRangeY
PixelRect(PixelSize)
Create a rectangle representing pixels on a screen
public PixelRect(PixelSize size)
Parameters
sizePixelSize
PixelRect(PixelSize, Pixel)
Create a rectangle representing pixels on a screen
public PixelRect(PixelSize size, Pixel offset)
Parameters
PixelRect(PixelSize, PixelOffset)
Create a rectangle representing pixels on a screen
public PixelRect(PixelSize size, PixelOffset offset)
Parameters
sizePixelSizeoffsetPixelOffset
PixelRect(IEnumerable<Pixel>)
public PixelRect(IEnumerable<Pixel> pixels)
Parameters
pixelsIEnumerable<Pixel>
PixelRect(float, float)
Create a rectangle representing pixels on a screen
public PixelRect(float width, float height)
Parameters
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
Fields
Bottom
public readonly float Bottom
Field Value
Left
public readonly float Left
Field Value
Right
public readonly float Right
Field Value
Top
public readonly float Top
Field Value
Properties
BottomCenter
public Pixel BottomCenter { get; }
Property Value
BottomLeft
public Pixel BottomLeft { get; }
Property Value
BottomLine
public PixelLine BottomLine { get; }
Property Value
BottomRight
public Pixel BottomRight { get; }
Property Value
Center
public Pixel Center { get; }
Property Value
HasArea
public bool HasArea { get; }
Property Value
Height
public float Height { get; }
Property Value
HorizontalCenter
public float HorizontalCenter { get; }
Property Value
LeftCenter
public Pixel LeftCenter { get; }
Property Value
LeftLine
public PixelLine LeftLine { get; }
Property Value
NaN
public static PixelRect NaN { get; }
Property Value
RightCenter
public Pixel RightCenter { get; }
Property Value
RightLine
public PixelLine RightLine { get; }
Property Value
Size
public PixelSize Size { get; }
Property Value
TopCenter
public Pixel TopCenter { get; }
Property Value
TopLeft
public Pixel TopLeft { get; }
Property Value
TopLine
public PixelLine TopLine { get; }
Property Value
TopRight
public Pixel TopRight { get; }
Property Value
VerticalCenter
public float VerticalCenter { get; }
Property Value
Width
public float Width { get; }
Property Value
Zero
public static PixelRect Zero { get; }
Property Value
Methods
AlignedInside(PixelRect, Alignment)
Return the position of this rectangle aligned inside a larger one
public PixelRect AlignedInside(PixelRect largerRect, Alignment alignment)
Parameters
Returns
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
largerRectPixelRectalignmentAlignmentpaddingPixelPadding
Returns
Contains(Pixel)
public bool Contains(Pixel px)
Parameters
pxPixel
Returns
Contains(float, float)
public bool Contains(float x, float y)
Parameters
Returns
ContainsX(float)
public bool ContainsX(float x)
Parameters
xfloat
Returns
ContainsY(float)
public bool ContainsY(float y)
Parameters
yfloat
Returns
Contract(PixelPadding)
public PixelRect Contract(PixelPadding padding)
Parameters
paddingPixelPadding
Returns
Contract(float)
public PixelRect Contract(float delta)
Parameters
deltafloat
Returns
Contract(float, float)
public PixelRect Contract(float x, float y)
Parameters
Returns
Equals(PixelRect)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(PixelRect other)
Parameters
otherPixelRectAn object to compare with this object.
Returns
- bool
true if the current object is equal to the
otherparameter; otherwise, false.
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
Expand(PixelPadding)
public PixelRect Expand(PixelPadding pad)
Parameters
padPixelPadding
Returns
Expand(PixelRect)
public PixelRect Expand(PixelRect other)
Parameters
otherPixelRect
Returns
Expand(float)
public PixelRect Expand(float delta)
Parameters
deltafloat
Returns
ExpandX(float)
public PixelRect ExpandX(float x)
Parameters
xfloat
Returns
ExpandY(float)
public PixelRect ExpandY(float y)
Parameters
yfloat
Returns
Fraction(FractionRect)
public PixelRect Fraction(FractionRect frac)
Parameters
fracFractionRect
Returns
GetAlignedPixel(Alignment)
public Pixel GetAlignedPixel(Alignment alignment)
Parameters
alignmentAlignment
Returns
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
otherPixelRectOther rectangle
Returns
- PixelRect
Intersection rectangle
ToSKRect()
public SKRect ToSKRect()
Returns
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
Returns
WithDelta(float, float, Alignment)
public PixelRect WithDelta(float x, float y, Alignment alignment)
Parameters
Returns
WithOffset(PixelOffset)
public PixelRect WithOffset(PixelOffset offset)
Parameters
offsetPixelOffset
Returns
WithPan(float, float)
public PixelRect WithPan(float x, float y)
Parameters
Returns
Operators
operator ==(PixelRect, PixelRect)
public static bool operator ==(PixelRect a, PixelRect b)
Parameters
Returns
operator !=(PixelRect, PixelRect)
public static bool operator !=(PixelRect a, PixelRect b)