Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get the REAL width of text
#1
Perfect for those who can't seem to centralise names [cleared]

I also found it useful when I made Nr completely in DX.

Code:
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
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
Code:
Public Type textSize
    width As Long
    Height As Long
End Type
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)