Interface ICursorComponent
Interface for creating and interacting with cursor images.
Inherited Members
Namespace: OpenTK .Platform
Assembly: OpenTK.Platform.dll
Syntax
public interface ICursorComponent : IPalComponent
Properties
CanInspectSystemCursors
True if the backend supports inspecting system cursor handles.
If true, functions like Getfals
, these functions will fail.
Declaration
bool CanInspectSystemCursors { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
CanLoadSystemCursors
True if the driver can load system cursors.
Declaration
bool CanLoadSystemCursors { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
Methods
Create(SystemCursorType)
Create a standard system cursor.
Declaration
CursorHandle Create(SystemCursorType systemCursor)
Parameters
Type | Name | Description |
---|---|---|
System |
systemCursor | Type of the standard cursor to load. |
Returns
Type | Description |
---|---|
Cursor |
A handle to the created cursor. |
Remarks
This function is only supported if Can
Exceptions
Type | Condition |
---|---|
Platform |
Driver does not implement this function. See Can |
See Also
Create(int, int, ReadOnlySpan<byte>, int, int)
Load a cursor image from memory.
Declaration
CursorHandle Create(int width, int height, ReadOnlySpan<byte> image, int hotspotX, int hotspotY)
Parameters
Type | Name | Description |
---|---|---|
int | width | Width of the cursor image. |
int | height | Height of the cursor image. |
Read |
image | Buffer containing image data in RGBA order. |
int | hotspotX | The x coordinate of the cursor hotspot. |
int | hotspotY | The y coordinate of the cursor hotspot. |
Returns
Type | Description |
---|---|
Cursor |
A handle to the created cursor. |
Exceptions
Type | Condition |
---|---|
Argument |
If |
Argument |
If |
Argument |
|
See Also
Create(int, int, ReadOnlySpan<byte>, ReadOnlySpan<byte>, int, int)
Load a cursor image from memory.
Declaration
CursorHandle Create(int width, int height, ReadOnlySpan<byte> colorData, ReadOnlySpan<byte> maskData, int hotspotX, int hotspotY)
Parameters
Type | Name | Description |
---|---|---|
int | width | Width of the cursor image. |
int | height | Height of the cursor image. |
Read |
colorData | Buffer containing RGB color data. |
Read |
maskData | Buffer containing mask data. Pixels where the mask is 1 will be visible while mask value of 0 is transparent. |
int | hotspotX | The x coordinate of the cursor hotspot. |
int | hotspotY | The y coordinate of the cursor hotspot. |
Returns
Type | Description |
---|---|
Cursor |
A handle to the created handle. |
Exceptions
Type | Condition |
---|---|
Argument |
If |
Argument |
If |
Argument |
|
See Also
Destroy(CursorHandle)
Destroy a cursor object.
Declaration
void Destroy(CursorHandle handle)
Parameters
Type | Name | Description |
---|---|---|
Cursor |
handle | Handle to a cursor object. |
See Also
GetHotspot(CursorHandle, out int, out int)
Get the hotspot location of the mouse cursor.
Declaration
void GetHotspot(CursorHandle handle, out int x, out int y)
Parameters
Type | Name | Description |
---|---|---|
Cursor |
handle | Handle to a cursor object. |
int | x | X coordinate of the hotspot. |
int | y | Y coordinate of the hotspot. |
Remarks
If handle
is a system cursor and Can
See Also
GetSize(CursorHandle, out int, out int)
Get the size of the cursor image.
Declaration
void GetSize(CursorHandle handle, out int width, out int height)
Parameters
Type | Name | Description |
---|---|---|
Cursor |
handle | Handle to a cursor object. |
int | width | Width of the cursor. |
int | height | Height of the cursor. |
Remarks
If handle
is a system cursor and Can
See Also
IsSystemCursor(CursorHandle)
Returns true if this cursor is a system cursor.
Declaration
bool IsSystemCursor(CursorHandle handle)
Parameters
Type | Name | Description |
---|---|---|
Cursor |
handle | Handle to a cursor. |
Returns
Type | Description |
---|---|
bool | If the cursor is a system cursor or not. |