Table of Contents

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)

Create a pixel, casting double values into ones with float precision

public Pixel(double x, double y)

Parameters

x double
y double

Pixel(float, float)

Create a pixel, casting double values into ones with float precision

public Pixel(float x, float y)

Parameters

x float
y float

Fields

X

Horizontal position on the screen in pixel units. Larger numbers are farther right on the screen.

public float X

Field Value

float

Y

Vertical position on the screen in pixel units. Larger numbers are lower on the screen.

public float Y

Field Value

float

Properties

NaN

Represents an invalid pixel location

public static Pixel NaN { get; }

Property Value

Pixel

Zero

public static Pixel Zero { get; }

Property Value

Pixel

Methods

DistanceFrom(Pixel)

public readonly float DistanceFrom(Pixel px2)

Parameters

px2 Pixel

Returns

float

Divide(float)

public readonly Pixel Divide(float v)

Parameters

v float

Returns

Pixel

Divide(float, float)

public readonly Pixel Divide(float x, float y)

Parameters

x float
y float

Returns

Pixel

Equals(Pixel)

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

public bool Equals(Pixel other)

Parameters

other Pixel

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.

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

Pixel

MovedLeft(float)

public readonly Pixel MovedLeft(float dX)

Parameters

dX float

Returns

Pixel

MovedRight(float)

public readonly Pixel MovedRight(float dX)

Parameters

dX float

Returns

Pixel

MovedUp(float)

public readonly Pixel MovedUp(float dY)

Parameters

dY float

Returns

Pixel

Multiply(float)

public readonly Pixel Multiply(float v)

Parameters

v float

Returns

Pixel

Multiply(float, float)

public readonly Pixel Multiply(float x, float y)

Parameters

x float
y float

Returns

Pixel

ToSKPoint()

Convert the ScottPlot pixel to a SkiaSharp point

public SKPoint ToSKPoint()

Returns

SKPoint

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

Pixel

WithOffset(float, float)

public readonly Pixel WithOffset(float dX, float dY)

Parameters

dX float
dY float

Returns

Pixel

Operators

operator +(Pixel, Pixel)

public static Pixel operator +(Pixel a, Pixel b)

Parameters

a Pixel
b Pixel

Returns

Pixel

operator /(Pixel, float)

public static Pixel operator /(Pixel a, float b)

Parameters

a Pixel
b float

Returns

Pixel

operator ==(Pixel, Pixel)

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

Parameters

a Pixel
b Pixel

Returns

bool

operator !=(Pixel, Pixel)

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

Parameters

a Pixel
b Pixel

Returns

bool

operator *(Pixel, float)

public static Pixel operator *(Pixel a, float b)

Parameters

a Pixel
b float

Returns

Pixel

operator -(Pixel, Pixel)

public static Pixel operator -(Pixel a, Pixel b)

Parameters

a Pixel
b Pixel

Returns

Pixel