FlutterDesktopGetDpiForHWND method

int FlutterDesktopGetDpiForHWND(
  1. int hwnd
)

Gets the DPI for a given hwnd, depending on the supported APIs per windows version and DPI awareness mode. If nullptr is passed, returns the DPI of the primary monitor.

This uses the same logic and fallback for older Windows versions that is used internally by Flutter to determine the DPI to use for displaying Flutter content, so should be used by any code (e.g., in plugins) that translates between Windows and Dart sizes/offsets.

Implementation

int FlutterDesktopGetDpiForHWND(
  int hwnd,
) =>
    _FlutterDesktopGetDpiForHWND(
      hwnd,
    );