C# Class OpenTK.DisplayDevice

Mostrar archivo Open project: andykorth/opentk Class Usage Examples

Private Properties

Property Type Description
DisplayDevice System
DisplayDevice System
FindResolution DisplayResolution

Public Methods

Method 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

Method 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 method

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.
return void

ChangeResolution() public method

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.
return void

GetDisplay() public static method

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

RestoreResolution() public method

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

SelectResolution() public method

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.
return DisplayResolution

ToString() public method

Returns a System.String representing this DisplayDevice.
public ToString ( ) : string
return string