C# Class OpenTK.DisplayDevice

Afficher le fichier Open project: andykorth/opentk Class Usage Examples

Private Properties

Свойство Type Description
DisplayDevice System
DisplayDevice System
FindResolution DisplayResolution

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
DisplayDevice ( ) : System
DisplayDevice ( DisplayResolution currentResolution, bool primary, IEnumerable availableResolutions, Rectangle bounds, object id ) : System
FindResolution ( int width, int height, int bitsPerPixel, float refreshRate ) : DisplayResolution

Method Details

ChangeResolution() public méthode

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.
Résultat void

ChangeResolution() public méthode

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.
Résultat void

GetDisplay() public static méthode

Gets the DisplayDevice for the specified DisplayIndex.
public static GetDisplay ( DisplayIndex index ) : DisplayDevice
index DisplayIndex The that defines the desired display.
Résultat DisplayDevice

RestoreResolution() public méthode

Restores the original resolution of the DisplayDevice.
Thrown if the original resolution could not be restored.
public RestoreResolution ( ) : void
Résultat void

SelectResolution() public méthode

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.
Résultat DisplayResolution

ToString() public méthode

Returns a System.String representing this DisplayDevice.
public ToString ( ) : string
Résultat string