BBjSystemMetrics::getDevicePixelRatio

Description

In BBj 15.0 and higher, this BBjSystemMetrics method returns the ratio of physical to logical pixels on the client screen device. High-DPI ("retina") displays report values greater than 1 (typically 2).

Syntax

Return Value

Method

BBjNumber

getDevicePixelRatio()

BBjNumber

getDevicePixelRatio(int screen)

Parameters

Variable

Description

screen

Specifies the screen number. Must be >= 0 and < BBjSystemMetrics::getScreenCount.

Return Value

Returns the ratio of physical to logical pixels on the client screen device.

Remarks

In BUI, this method corresponds to the browser's window.devicePixelRatio value.

Example

rem ' BBjSystemMetrics::getDevicePixelRatio

sysgui = unt

open (sysgui)"X0"

sysgui! = bbjapi().getSysGui()

metrics! = sysgui!.getSystemMetrics()

print "Default:"

print "getScreenResolution:",metrics!.getScreenResolution()," DPI"

print "getDevicePixelRatio:",metrics!.getDevicePixelRatio()

print "getScreenSize: ",metrics!.getScreenSize()

print "getScreenBounds: ",metrics!.getScreenBounds()

print "getScreenInsets: ",metrics!.getScreenInsets()

screens = metrics!.getScreenCount()

for screen = 0 to screens-1

 print ""

 print "Screen",screen,":"

 print "getDevicePixelRatio",screen,":",metrics!.getDevicePixelRatio(screen)

 print "getScreenSize",screen,": ",metrics!.getScreenSize(screen)

 print "getScreenBounds",screen,": ",metrics!.getScreenBounds(screen)

 print "getScreenInsets",screen,": ",metrics!.getScreenInsets(screen)

next screen

See Also

BBjAPI

BBjSysGui

Object Variables

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.