StringHeight
Previous  Next

Returns the height (number of pixels) of a specified string.
Syntax: StringHeight (string As String, FontSize As Single) As Int32

Example: Draws a string and a rectangle around the string.
'Add a Drawer object named drawer a Brush object named brush1, a Pen object named pen1 and a Rectangle object named rect.
Sub Globals

End Sub

Sub App_Start
      Form1.Show
      brush1.New1 (cBlack)
      pen1.New1 (cBlue)
      drawer.New1("Form1",false)
      s = "Hello World!"
      drawer.DrawString1(s, 12,brush1.Value,10,10)
      rect1.New1(8,8, drawer.StringWidth(s,12) + 4, drawer.StringHeight(s,12) + 4)
      drawer.DrawRectangle(pen1.Value, rect1.Value)
End Sub