IWithPixelDensity

interface

Namespace: Vuplex.WebView

An interface implemented by a webview if it supports changing its pixel density, which is its number of physical pixels per logical pixel. The default pixel density is 1, but increasing it to 2 can make web content appear sharper or less blurry on high DPI displays.

Example

await webViewPrefab.WaitUntilInitialized();
var webViewWithPixelDensity = webViewPrefab.WebView as IWithPixelDensity;
if (webViewWithPixelDensity == null) {
    Debug.Log("This 3D WebView plugin doesn't yet support IWithPixelDensity: " + webViewPrefab.WebView.PluginType);
} else {
    webViewWithPixelDensity.SetPixelDensity(2);
}

Important note

For the macOS WebKit plugin, increasing the pixel density is disabled by default because it negatively impacts performance, particularly on Macs with Intel processors. However, you can override this with MacWebKitWebView.PixelDensityEnabled.

Summary

Public properties

Public properties

PixelDensity

float PixelDensity { get; }

Gets the current pixel density.

Public methods

SetPixelDensity

void SetPixelDensity(float pixelDensity)

Sets the pixel density. The value must be between 0 and 10, and the default is 1.