PhysicalSize
Defined in: dpi.ts:87
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
new PhysicalSize(
width,height):PhysicalSize
Defined in: dpi.ts:92
number
number
PhysicalSize
new PhysicalSize(
object):PhysicalSize
Defined in: dpi.ts:93
{ height: number; width: number; }
number
number
PhysicalSize
new PhysicalSize(
object):PhysicalSize
Defined in: dpi.ts:94
number
number
PhysicalSize
height:
number
Defined in: dpi.ts:90
readonlytype:"Physical"='Physical'
Defined in: dpi.ts:88
width:
number
Defined in: dpi.ts:89
__TAURI_TO_IPC_KEY__():
object
Defined in: dpi.ts:130
object
height:
number
width:
number
toJSON():
object
Defined in: dpi.ts:137
object
height:
number
width:
number
toLogical(
scaleFactor):LogicalSize
Defined in: dpi.ts:126
Converts the physical size to a logical one.
number
import { getCurrentWindow } from '@tauri-apps/api/window';const appWindow = getCurrentWindow();const factor = await appWindow.scaleFactor();const size = await appWindow.innerSize(); // PhysicalSizeconst logical = size.toLogical(factor);© 2025 Tauri Contributors. CC-BY / MIT