共用方式為


BrightnessOverride.SetBrightnessLevel 方法

定義

設定亮度等級和覆寫選項。 當您的應用程式準備好以您想要覆寫的模式變更目前的亮度時,請呼叫 StartOverride

public:
 virtual void SetBrightnessLevel(double brightnessLevel, DisplayBrightnessOverrideOptions options) = SetBrightnessLevel;
void SetBrightnessLevel(double const& brightnessLevel, DisplayBrightnessOverrideOptions const& options);
public void SetBrightnessLevel(double brightnessLevel, DisplayBrightnessOverrideOptions options);
function setBrightnessLevel(brightnessLevel, options)
Public Sub SetBrightnessLevel (brightnessLevel As Double, options As DisplayBrightnessOverrideOptions)

參數

brightnessLevel
Double

double

螢幕的亮度。 值應介於 0.0 和 1.0 的範圍內,其中 1.0 為 100% 亮度。

options
DisplayBrightnessOverrideOptions

在亮度覆寫會話期間修改螢幕亮度等級的選項。

範例

// Set display to 80% brightness and, if the device is on low battery during overriding,
// then allow the display to dim. */

bo.SetBrightnessLevel(0.80, DisplayBrightnessOverrideOptions.UseDimmedPolicyWhenBatteryIsLow);

適用於