C# Класс OpenTK.DisplayDevice

Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
DisplayDevice System
DisplayDevice System
FindResolution DisplayResolution

Открытые методы

Метод Описание
ChangeResolution ( DisplayResolution resolution ) : void

Changes the resolution of the DisplayDevice.

If the specified resolution is null, this function will restore the original DisplayResolution.

ChangeResolution ( int width, int height, int bitsPerPixel, float refreshRate ) : void

Changes the resolution of the DisplayDevice.

GetDisplay ( DisplayIndex index ) : DisplayDevice

Gets the DisplayDevice for the specified DisplayIndex.

RestoreResolution ( ) : void

Restores the original resolution of the DisplayDevice.

SelectResolution ( int width, int height, int bitsPerPixel, float refreshRate ) : DisplayResolution

Selects an available resolution that matches the specified parameters.

If a matching resolution is not found, this function will retry ignoring the specified refresh rate, bits per pixel and resolution, in this order. If a matching resolution still doesn't exist, this function will return the current resolution.

A parameter set to 0 or negative numbers will not be used in the search (e.g. if refreshRate is 0, any refresh rate will be considered valid).

This function allocates memory.

ToString ( ) : string

Returns a System.String representing this DisplayDevice.

Приватные методы

Метод Описание
DisplayDevice ( ) : System
DisplayDevice ( DisplayResolution currentResolution, bool primary, IEnumerable availableResolutions, Rectangle bounds, object id ) : System
FindResolution ( int width, int height, int bitsPerPixel, float refreshRate ) : DisplayResolution

Описание методов

ChangeResolution() публичный Метод

Changes the resolution of the DisplayDevice.
If the specified resolution is null, this function will restore the original DisplayResolution.
Thrown if the requested resolution could not be set.
public ChangeResolution ( DisplayResolution resolution ) : void
resolution DisplayResolution The resolution to set.
Результат void

ChangeResolution() публичный Метод

Changes the resolution of the DisplayDevice.
Thrown if the requested resolution could not be set.
public ChangeResolution ( int width, int height, int bitsPerPixel, float refreshRate ) : void
width int The new width of the DisplayDevice.
height int The new height of the DisplayDevice.
bitsPerPixel int The new bits per pixel of the DisplayDevice.
refreshRate float The new refresh rate of the DisplayDevice.
Результат void

GetDisplay() публичный статический Метод

Gets the DisplayDevice for the specified DisplayIndex.
public static GetDisplay ( DisplayIndex index ) : DisplayDevice
index DisplayIndex The that defines the desired display.
Результат DisplayDevice

RestoreResolution() публичный Метод

Restores the original resolution of the DisplayDevice.
Thrown if the original resolution could not be restored.
public RestoreResolution ( ) : void
Результат void

SelectResolution() публичный Метод

Selects an available resolution that matches the specified parameters.

If a matching resolution is not found, this function will retry ignoring the specified refresh rate, bits per pixel and resolution, in this order. If a matching resolution still doesn't exist, this function will return the current resolution.

A parameter set to 0 or negative numbers will not be used in the search (e.g. if refreshRate is 0, any refresh rate will be considered valid).

This function allocates memory.

public SelectResolution ( int width, int height, int bitsPerPixel, float refreshRate ) : DisplayResolution
width int The width of the requested resolution in pixels.
height int The height of the requested resolution in pixels.
bitsPerPixel int The bits per pixel of the requested resolution.
refreshRate float The refresh rate of the requested resolution in hertz.
Результат DisplayResolution

ToString() публичный Метод

Returns a System.String representing this DisplayDevice.
public ToString ( ) : string
Результат string