Guidance
指路人
g.yi.org
software / rapidq / Examples / String & Text / FontSize.bas

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  

     CONST LOGPIXELSX = 88
     DECLARE FUNCTION GetDesktopWindow LIB "user32" ALIAS "GetDesktopWindow" () AS LONG
     DECLARE FUNCTION GetDC LIB "user32" ALIAS "GetDC"(BYVAL hWnd AS LONG) AS LONG
     DECLARE FUNCTION GetDeviceCaps LIB "gdi32" ALIAS "GetDeviceCaps" (BYVAL hdc AS LONG, BYVAL nIndex AS LONG) AS LONG
     DECLARE FUNCTION ReleaseDC LIB "user32" ALIAS "ReleaseDC" (BYVAL hWnd AS LONG, BYVAL hdc AS LONG) AS LONG
     DECLARE FUNCTION CheckForSmallFonts() AS LONG


     A = CheckForSmallFonts                                   ' font size in DPI   96=small, 120=big
     FontSize=17-FIX(A/12)                                    ' results 7 for big, 10 for small




     FUNCTION CheckForSmallFonts() AS LONG
      DIM hWndDesk AS LONG
      DIM hDCDesk AS LONG
      DIM logPix AS LONG
      hWndDesk = GetDesktopWindow()
      hDCDesk = GetDC(hWndDesk)
      logPix = GetDeviceCaps(hDCDesk, LOGPIXELSX)
      CALL ReleaseDC(hWndDesk, hDCDesk)
      CheckForSmallFonts = logPix
     END FUNCTION
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2019-7-20  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-08-31 08:38:50