Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exact Center? - BltPlayerName
#2
to get the text size of a string you can use this.

Code:
Public Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As Long, ByVal lpsz As String, ByVal cbString As Long,  lpSize As textSize) As Long

Public Function getSize(ByVal DC As Long, ByVal Text As String) As textSize
    Dim lngReturn As Long
    Dim typSize As textSize
    
    lngReturn = GetTextExtentPoint32(DC, Text, Len(Text), typSize)
    
    getSize = typSize
End Function

Public Type textSize
    width As Long
    height As Long
End Type
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)