Show / Hide Table of Contents

Class MouseCursor

Represents a predefined or custom mouse cursor.

Inheritance
Object
WindowIcon
MouseCursor
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: OpenTK
Assembly: OpenTK.dll
Syntax
public sealed class MouseCursor : WindowIcon

Constructors

MouseCursor(Int32, Int32, Int32, Int32, Byte[])

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

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
Int32 hotx

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

Int32 hoty

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

Int32 width

The width of the cursor data, in pixels.

Int32 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 BGRA pixels.

MouseCursor(Int32, Int32, Int32, Int32, IntPtr)

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

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, IntPtr data)
Parameters
Type Name Description
Int32 hotx

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

Int32 hoty

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

Int32 width

The width of the cursor data, in pixels.

Int32 height

The height of the cursor data, in pixels.

IntPtr data

A pointer to the cursor image, laid out as a contiguous array of BGRA pixels.

Properties

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
In This Article
Back to top Generated by DocFX