Show / Hide Table of Contents

Interface IIconComponent

Interface creatiing and interacting with window icon images.

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

Properties

CanLoadSystemIcons

If common system icons can be created. If this is true then Create(SystemIconType) will work, otherwise an exception will be thrown.

Declaration
bool CanLoadSystemIcons { get; }
Property Value
Type Description
bool
See Also
Create(SystemIconType)

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.

Exceptions
Type Condition
PlatformNotSupportedException

Platform does not implement this function. See CanLoadSystemIcons.

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 in RGBA format.

Returns
Type Description
IconHandle

A handle to the created icon.

Exceptions
Type Condition
ArgumentOutOfRangeException

If width, or height are negative.

ArgumentException

data is smaller than specified dimensions.

Destroy(IconHandle)

Destroy an icon object.

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

Handle to the icon object to destroy.

See Also
Create(SystemIconType)
Create(int, int, ReadOnlySpan<byte>)

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.

See Also

Icon
In this article
Back to top Generated by DocFX