Show / Hide Table of Contents

Class MouseCursor

Represents a predefined or custom mouse cursor.

Inheritance
object
Image
MouseCursor
Inherited Members
Image.Width
Image.Height
Image.Data
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OpenTK.Windowing.Common.Input
Assembly: OpenTK.Windowing.Common.dll
Syntax
public sealed class MouseCursor : Image

Constructors

MouseCursor(int, int, int, int, byte[])

Initializes a new instance of the MouseCursor class from a contiguous array of RGBA pixels. Each pixel is composed of 4 bytes, representing R, G, B and A values, respectively. On some backends, the R, G, and B components should be premultiplied with the A component for correct antialiasing of translucent cursors:

B = (byte)((B * A) / 255)
G = (byte)((G * A) / 255)
R = (byte)((R * A) / 255)
Declaration
public MouseCursor(int hotX, int hotY, int width, int height, byte[] data)
Parameters
Type Name Description
int hotX

The x-coordinate of the cursor hotspot, in the range [0, width].

int hotY

The y-coordinate of the cursor hotspot, in the range [0, height].

int width

The width of the cursor data, in pixels.

int height

The height of the cursor data, in pixels.

byte[] data

A byte array representing the cursor image, laid out as a contiguous array of RGBA pixels.

Properties

Crosshair

Gets the default crosshair cursor for this platform.

Declaration
public static MouseCursor Crosshair { get; }
Property Value
Type Description
MouseCursor

Default

Gets the default mouse cursor for this platform.

Declaration
public static MouseCursor Default { get; }
Property Value
Type Description
MouseCursor

Empty

Gets an empty (invisible) mouse cursor.

Declaration
public static MouseCursor Empty { get; }
Property Value
Type Description
MouseCursor

Hand

Gets the default hand cursor for this platform.

Declaration
[Obsolete("Use PointingHand instead.")]
public static MouseCursor Hand { get; }
Property Value
Type Description
MouseCursor

HResize

Gets the default horizontal cursor for this platform.

Declaration
[Obsolete("Use PointingHand instead.")]
public static MouseCursor HResize { get; }
Property Value
Type Description
MouseCursor

IBeam

Gets the default I beam cursor for this platform.

Declaration
public static MouseCursor IBeam { get; }
Property Value
Type Description
MouseCursor

NotAllowed

Gets the default operation-not-allowed cursor for this platform.

Declaration
public static MouseCursor NotAllowed { get; }
Property Value
Type Description
MouseCursor

PointingHand

Gets the default pointing hand cursor for this platform.

Declaration
public static MouseCursor PointingHand { get; }
Property Value
Type Description
MouseCursor

ResizeAll

Gets the default omni-directional diagonal resize cursor for this platform.

Declaration
public static MouseCursor ResizeAll { get; }
Property Value
Type Description
MouseCursor

ResizeEW

Gets the default pointing hand cursor for this platform.

Declaration
public static MouseCursor ResizeEW { get; }
Property Value
Type Description
MouseCursor

ResizeNESW

Gets the default notheast southwest diagonal resize cursor for this platform.

Declaration
public static MouseCursor ResizeNESW { get; }
Property Value
Type Description
MouseCursor

ResizeNS

Gets the default pointing hand cursor for this platform.

Declaration
public static MouseCursor ResizeNS { get; }
Property Value
Type Description
MouseCursor

ResizeNWSE

Gets the default northwest southeast diagonal resize cursor for this platform.

Declaration
public static MouseCursor ResizeNWSE { get; }
Property Value
Type Description
MouseCursor

Shape

Gets the shape for standard preset cursors.

Declaration
public MouseCursor.StandardShape Shape { get; }
Property Value
Type Description
MouseCursor.StandardShape

VResize

Gets the default vertical resize cursor for this platform.

Declaration
[Obsolete("Use PointingHand instead.")]
public static MouseCursor VResize { get; }
Property Value
Type Description
MouseCursor

X

Gets the x-coordinate of the cursor hotspot.

Declaration
public int X { get; }
Property Value
Type Description
int

Y

Gets the y-coordinate of the cursor hotspot.

Declaration
public int Y { get; }
Property Value
Type Description
int
In This Article
Back to top Generated by DocFX