Re: win32lib - is it possible to find out users font display size

new topic     » goto parent     » topic index » view thread      » older message » newer message

You can use queryDevice() with LOGPIXELSX and LOGPIXELSY to get the screen DPI.

  • Small = 96 DPI
  • Medium = 120 DPI
  • Large = 144 DPI
include Win32Lib.ew 
 
sequence logpixelsx = queryDevice( Screen, LOGPIXELSX ) 
if length( logpixelsx ) = 1 then 
    logpixelsx = sprintf( "LOGPIXELSX = %d", logpixelsx[1] ) 
end if 
 
sequence logpixelsy = queryDevice( Screen, LOGPIXELSY ) 
if length( logpixelsy ) = 1 then 
    logpixelsy = sprintf( "LOGPIXELSY = %d", logpixelsy[1] ) 
end if 
 
constant 
    Main    = create( Window, "Screen DPI", 0, Default, Default, 360, 240, 0 ), 
    LabelX  = create( LText, logpixelsx, Main, 10, 10, 100, 20, 0 ), 
    LabelY  = create( LText, logpixelsy, Main, 10, 40, 100, 20, 0 ), 
$ 
 
WinMain( Main, Normal ) 

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu