ASP Painter
Home
Home
Samples
Samples
Purchase
Purchase
Download
Download
Documentation
Documentation


ASPPainter Samples

Sample 3 - True type fonts. 

Filled rectangles, copying images
 


Dim pic
Set pic = CreateObject("ASPPainter.Pictures.1")
pic.SetBKColor 255,0,0,255
pic.Create 200,100

pic.SetColor 0,0,255,255
pic.SetColorIndex 1
pic.SetColor 0,255,0,255

pic.SetGradient 0,0, 200,100
pic.DrawFilledRectangle 0,0,200,100


pic.SetFontName "Arial"
pic.SetFontSize 10
pic.SetColor 255,255,255,255
pic.SetColorIndex 0
pic.SetColor 255,255,0,255
pic.SetColorIndex 1
pic.SetColor 255,0,0,255
pic.SetGradient 0,0, 200,100


fontHeight = pic.GetFontHeight
line = 0




pic.SetFontOrientation 0


pic.TextOut 10,line, "Regular"
pic.SetFontBold 1
line = fontHeight +line
pic.TextOut 10,line, "Bold"
pic.SetFontBold 0
'pic.SaveToFile "C:\style1.png"

pic.SetFontItalic 1
line = fontHeight +line
pic.TextOut 10,line, "Italic"
pic.SetFontItalic 0
pic.SetFontUnderLine 1
line = fontHeight +line
pic.TextOut 10,line, "Underline"
pic.SetFontUnderLine 0
pic.SetFontStrikeOut 1
line = fontHeight +line
pic.TextOut 10,line, "Strikeout"
pic.SetFontBold 1

pic.SetFontBold 1
pic.SetFontItalic 1
pic.SetFontUnderLine 1
pic.SetFontStrikeOut 1
line = fontHeight +line
pic.TextOut 10,line, "Arial.ttf"
pic.SetFontName "Verdana"
pic.SetFontStrikeOut 0
fontHeight = pic.GetFontHeight
line = 0 
'line = fontHeight +line
pic.ClearGradient
pic.SetColor 255,255,255,255
pic.SetFontAntialias 1
pic.SetFontRectangle 100,0,199,99
pic.DrawRectangle 100,0,199,99
pic.setTextAlign 0
pic.TextOut 0,0, "Verdana.ttf true type font in rectangle"


pic.SaveToFile "C:\fonts.png"
pic.DestroyALL

Set pic = Nothing


Figure 1. fonts.png (size - 12.2 Kb)



home samples purchase documentation download