Show / Hide Table of Contents

Class MouseCursor

Represents a predefined or custom mouse cursor.

Inheritance
System.Object
WindowIcon
MouseCursor
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: OpenTK
Assembly: cs.temp.dll.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
System.Int32 hotx

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

System.Int32 hoty

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

System.Int32 width

The width of the cursor data, in pixels.

System.Int32 height

The height of the cursor data, in pixels.

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

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

System.Int32 hoty

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

System.Int32 width

The width of the cursor data, in pixels.

System.Int32 height

The height of the cursor data, in pixels.

System.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
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX