by Seraphire (1 Submission)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (8 Votes)
Font Rotate: This code provides a user method to draw text on a anything with a device Context (form, user control, printer, etc.) at any angle. This is a rework of code found on VBC by ZATRiX
Inputs
The DrawText routine takes the following:
* ByRef Canvas As Object - Device getting "drawn" on
* ByVal txt As String - text to write
* ByVal X As Single - X Coordinate
* ByVal Y As Single - Y Coordinate
* ByVal font_name As String - Font Face to use
* ByVal size As Long - Font Size
* ByVal Angle As Single - Angle of Rotation
* ByVal weight As FontWeight - How heavy a pen
* ByVal Italic As Boolean - Italic?
* ByVal Underline As Boolean - Underline ?
* ByVal Strikethrough As Boolean - Strikethrough?
Assumes
Make sure that your drawing canvas has the "AutoRedraw" property set to true, otherwise your text may dissappear off the control.