Loading ...
Sorry, an error occurred while loading the content.

32259AW: [libertybasic] Text box font size problem

Expand Messages
  • Stefan Pendl
    Nov 1, 2006
    • 0 Attachment
      >
      > Did you issue a font command to the main window or the
      > textbox? It may simply be that the default fonts are set
      > differently on the computers.
      >
      > Janet
      >

      Use the function below to get the DPI settings of the current display.
      Use the returned value to scale the window size, control size and text size.

      '---code start
      print GetScreenScale()
      end

      function GetScreenScale()
      calldll #user32, "GetDC",_
      0 as ulong,_ ' entire screen
      hDC as ulong

      nIndex = _LOGPIXELSX

      calldll #gdi32, "GetDeviceCaps",_
      hDC as ulong,_
      nIndex as ulong,_
      dpi as ulong

      calldll #user32, "ReleaseDC",_
      0 as ulong,_ ' entire screen
      hDC as ulong,_
      result as ulong ' 1 = success

      select case dpi
      case 72
      GetScreenScale = .75
      case 96
      GetScreenScale = 1
      case 120
      GetScreenScale = 1.25
      case 144
      GetScreenScale = 1.5
      case 192
      GetScreenScale = 2
      end select
      end function
      '---code end

      ---
      Stefan Pendl



      ___________________________________________________________
      Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
    • Show all 11 messages in this topic