Android Guides | Samples

OpenTK.DisplayDevice.SelectResolution Method

Selects an available resolution that matches the specified parameters.

Syntax

public DisplayResolution SelectResolution (Int32 width, Int32 height, Int32 bitsPerPixel, Single refreshRate)

Parameters

width
The width of the requested resolution in pixels.
height
The height of the requested resolution in pixels.
bitsPerPixel
The bits per pixel of the requested resolution.
refreshRate
The refresh rate of the requested resolution in hertz.

Returns

The requested DisplayResolution or null if the parameters cannot be met.

Remarks

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.

Requirements

Namespace: OpenTK
Assembly: OpenTK-1.0 (in OpenTK-1.0.dll)
Assembly Versions: 1.0.0.0