ASPPainter::Text::Font.vbs
' Define object variable
Dim pic
' Create object
Set pic = CreateObject("ASPPainter.Pictures.1")
' Set background color in RGB format
pic.SetBKColor 191,255,255,255
' Create image with specified width and height
pic.Create 150,75
pic.SetColor 0,0,0,255
' Set foreground color in RGB format (black)
'TrueType font
pic.SetFontName "Verdana"
pic.SetFontSize 14
pic.SetFontBold 1
pic.SetFontAntialias 1
pic.TextOut 10,40, "TrueType"
' Save Image to file.
pic.SaveToFile "C:\font.png"
' Delete image and free memory
pic.DestroyALL
Set pic = Nothing
' Clear the variable
 |
Picture 1. font.png |
More samples:
Antialias,
Exist font, Font,
Fonts, Rotate text,
Style,
Text gradient, Text in
rectangle
See also:
TextOut,
SetFontBold, SetFontItalic,
SetFontUnderline,
SetFontStrikeOut,
GetFontHeight,
SetFontSize, SetFontName,
SetFontAntialias,
SetFontOrientation,
SetJpegQuality,
ExistFont, SetFontRectangle,
ClearFontRectangle,
SetTextAlign,
SetColorIndex, SetGradient,
ClearGradient,
SetColor, SetBKColor,
Create ,
SaveToFile , DestroyALL