Show / Hide Table of Contents

Interface IIconComponent

Interface for PAL drivers which provide the icon component.

Inherited Members
IPalComponent.Name
IPalComponent.Provides
IPalComponent.Logger
IPalComponent.Initialize(ToolkitOptions)
Namespace: OpenTK.Core.Platform
Assembly: OpenTK.Core.dll
Syntax
public interface IIconComponent : IPalComponent

Properties

CanLoadSystemIcons

True if icon objects can be populated from common system icons. If this is true, then Create(SystemIconType) will work, otherwise an exception will be thrown.

Declaration
bool CanLoadSystemIcons { get; }
Property Value
Type Description
bool

Methods

Create(SystemIconType)

Load a system icon. Only works if CanLoadSystemIcons is true.

Declaration
IconHandle Create(SystemIconType systemIcon)
Parameters
Type Name Description
SystemIconType systemIcon

The system icon to create.

Returns
Type Description
IconHandle

A handle to the created system icon.

See Also
CanLoadSystemIcons

Create(int, int, ReadOnlySpan<byte>)

Load an icon object with image data.

Declaration
IconHandle Create(int width, int height, ReadOnlySpan<byte> data)
Parameters
Type Name Description
int width

Width of the bitmap.

int height

Height of the bitmap.

ReadOnlySpan<byte> data

Image data to load into icon.

Returns
Type Description
IconHandle

A handle to the created icon.

Destroy(IconHandle)

Destroy an icon object.

Declaration
void Destroy(IconHandle handle)
Parameters
Type Name Description
IconHandle handle

Handle to the icon object to destroy.

Exceptions
Type Condition
ArgumentNullException

handle is null.

GetSize(IconHandle, out int, out int)

Get the dimensions of a icon object.

Declaration
void GetSize(IconHandle handle, out int width, out int height)
Parameters
Type Name Description
IconHandle handle

Handle to icon object.

int width

Width of the icon.

int height

Height of icon.

Exceptions
Type Condition
ArgumentNullException

handle is null.

In this article
Back to top Generated by DocFX