比如说字体大小是-11,有十个字符,它在屏幕上所占的范围的高和宽是多少?其它字体呢?有没有一个换算的公式?

解决方案 »

  1.   

    用GetTextExtentPoint函数来计算。
      

  2.   

    用GetTextExtentPoint32函数来计算
      

  3.   

    呵呵,再问问,在win95、win98、win2000下用的函数一样吗?
      

  4.   

    GetTextExtentPoint32Requirements 
      Windows NT/2000/XP: Included in Windows NT 3.5 and later.
      Windows 95/98/Me: Included in Windows 95 and later.
      

  5.   

    在VisualC++6.0技术内幕的字体这一章有公式,你查查
      

  6.   

    CSize GetTextExtent( LPCTSTR lpszString, int nCount ) const;CSize GetTextExtent( const CString& str ) const;