GetTextHeight
Height = GetTextHeight(String$)
 
Parameters:

    String$ = The String you want to return the width of
Returns:

    Height = The height in pixels of this string of text
 

The GetTextHeight function returns the height (in pixels) of a string of text.



FACTS:


* GetTextHeight uses the current font to calculate the pixel height from.



Mini Tutorial:


This example displays the pixel width & height of the text message "hello World" in both the default font, and the Arial font.


  
; Display the Pixel Width/Height of the
; message Hello World, when the
; current font is set to font #1
  
  Print GetTextWidth("Hello World")
  Print GetTextHeight("Hello World")
  
; Load the "Arial" font as font 2, size 24, in
; the normal style
  LoadFont "Arial",2,24,0
  
; Set Font 2 at the current font.
  SetFont 2
  
; Display the Pixel Width/height of the
; message HEllo World, when the
; current font is set to font #2 (Arial)
  Print GetTextWidth("Hello World")
  Print GetTextHeight("Hello World")
  
  
; Display the screen and wait for a key top be pressed
  Sync
  WaitKey
  
  




This example would output.

  
  88
  13
  107
  24
  

 
Related Info: GetCurrentFont | GetFontHeight | GetFontWidth | GetTextWidth | SetFont :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com