Interface DevicePixelRatioObserver

Instances of [[DevicePixelRatioObserver]] can be registered with a [[DevicePixelRatioMonitor]] to receive callbacks for a change in the HTML window's device pixel ratio.

interface DevicePixelRatioObserver {
    devicePixelRatioChanged(newDevicePixelRatio: number): void;
}

Implemented by

Methods

  • Called when the device pixel ratio monitor detects a change in the HTML window's device pixel ratio. This can happen if the window is dragged to a monitor with a different hi-dpi characteristics.

    Parameters

    • newDevicePixelRatio: number

    Returns void