Tauri Core API - v2.6.0
    Preparing search index...

    Class PhysicalSize

    A size represented in physical pixels.

    Physical pixels represent actual screen pixels, and are DPI-independent. For high-DPI windows, this means that any point in the window on the screen will have a different position in logical pixels (@linkcode LogicalSize).

    For physical-pixel-based position, see PhysicalPosition.

    2.0.0

    Index

    Constructors

    Properties

    type: "Physical" = 'Physical'
    width: number
    height: number

    Methods

    • Converts the physical size to a logical one.

      Parameters

      • scaleFactor: number

      Returns dpi.LogicalSize

      import { getCurrentWindow } from '@tauri-apps/api/window';
      const appWindow = getCurrentWindow();
      const factor = await appWindow.scaleFactor();
      const size = await appWindow.innerSize(); // PhysicalSize
      const logical = size.toLogical(factor);
    • Returns { width: number; height: number }

    • Returns { width: number; height: number }