Skip to content

WindowScale

Narta Xaymar Dirks edited this page Nov 1, 2026 · 1 revision
BlitzLLVM

WindowScale 〔BlitzLLVM〕

WindowScale:Float32 window:Int32
Parameter Mode Type Default Description
window In Int32 required Handle of a window.

Returns: The scale of the display of the window, 1.0 for a window that is drawn inside the window of Graphics.

Description

〔BlitzLLVM〕 This command does not exist in the original Blitz products. BlitzLLVM adds it.

A BlitzLLVM extension: the scale of the display that a window is on, as the system wants things on it to be larger than normal. 1.0 is normal, 1.5 is Windows at 150 %, 2.0 is a Retina display. The runtime scales the window by it, so that it is as big as on a normal display and its gadgets are drawn sharp at that scale, while the program keeps counting in its own units; see CreateWindow. A program that scales by itself turns that off with WindowScaling 0 and uses this number to size its gadgets and draw its canvases. The event $805 is sent when the scale of a window changes, with the scale in percent in EventData.

Differences

  • Not in the original, whose windows are scaled by Windows without the program knowing.

Examples

win = CreateWindow("Scale", 20, 20, 300, 120, Desktop(), 15)
label = CreateLabel("This window is scaled by " + WindowScale(win), 10, 10, 280, 20, win)
Repeat
	e = WaitEvent()
	If e = $805 Then SetGadgetText label, "Now scaled by " + (EventData() / 100.0)
Until e = $803

Related Commands

ActivateWindow, ActiveWindow, CreateWindow, MaximizeWindow, WindowMaximized, WindowMenu, WindowMinimized, WindowScaling 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally