Struct Pixel
- Namespace
- ScottPlot
- Assembly
- ScottPlot.dll
Represents an X/Y location on screen in pixel units. Pixels in screen units are distinct from Coordinates with axis units. Pixels use float precision, whereas Coordinates use double precision.
public struct Pixel : IEquatable<Pixel>
- Implements
- Inherited Members
- Extension Methods
Constructors
Pixel(double, double)
public Pixel(double x, double y)
Parameters
Pixel(float, float)
public Pixel(float x, float y)
Parameters
Fields
X
Horizontal position on the screen in pixel units. Larger numbers are farther right on the screen.
public float X
Field Value
Y
Vertical position on the screen in pixel units. Larger numbers are lower on the screen.
public float Y
Field Value
Properties
NaN
Represents an invalid pixel location
public static Pixel NaN { get; }
Property Value
Zero
public static Pixel Zero { get; }
Property Value
Methods
DistanceFrom(Pixel)
public readonly float DistanceFrom(Pixel px2)
Parameters
px2
Pixel
Returns
Divide(float)
public readonly Pixel Divide(float v)
Parameters
v
float
Returns
Divide(float, float)
public readonly Pixel Divide(float x, float y)
Parameters
Returns
Equals(Pixel)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Pixel other)
Parameters
other
PixelAn 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
objectThe 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.
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.
MovedDown(float)
public readonly Pixel MovedDown(float dY)
Parameters
dY
float
Returns
MovedLeft(float)
public readonly Pixel MovedLeft(float dX)
Parameters
dX
float
Returns
MovedRight(float)
public readonly Pixel MovedRight(float dX)
Parameters
dX
float
Returns
MovedUp(float)
public readonly Pixel MovedUp(float dY)
Parameters
dY
float
Returns
Multiply(float)
public readonly Pixel Multiply(float v)
Parameters
v
float
Returns
Multiply(float, float)
public readonly Pixel Multiply(float x, float y)
Parameters
Returns
ToSKPoint()
Convert the ScottPlot pixel to a SkiaSharp point
public SKPoint ToSKPoint()
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
WithOffset(PixelOffset)
public readonly Pixel WithOffset(PixelOffset offset)
Parameters
offset
PixelOffset
Returns
WithOffset(float, float)
public readonly Pixel WithOffset(float dX, float dY)
Parameters
Returns
Operators
operator +(Pixel, Pixel)
public static Pixel operator +(Pixel a, Pixel b)
Parameters
Returns
operator /(Pixel, float)
public static Pixel operator /(Pixel a, float b)
Parameters
Returns
operator ==(Pixel, Pixel)
public static bool operator ==(Pixel a, Pixel b)
Parameters
Returns
operator !=(Pixel, Pixel)
public static bool operator !=(Pixel a, Pixel b)
Parameters
Returns
operator *(Pixel, float)
public static Pixel operator *(Pixel a, float b)
Parameters
Returns
operator -(Pixel, Pixel)
public static Pixel operator -(Pixel a, Pixel b)