Class MouseCursor
Represents a predefined or custom mouse cursor.
Inherited Members
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
public static MouseCursor Hand { get; }
Property Value
Type | Description |
---|---|
MouseCursor |
HResize
Gets the default horizontal cursor for this platform.
Declaration
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 |
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
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 |