[VBScript]
Set mycanvas = Server.CreateObject("ImageGlue7.Canvas")
mytext = "In a hole in the ground there lived a hobbit. Not a
nasty, dirty, wet hole, filled with the ends of worms and an oozy
smell, nor yet a dry, bare, sandy hole with..."
myparams = "Rect=10,10,290,290"
mycanvas.Color = "cyan"
mycanvas.Width = 300
mycanvas.Height = 300
mycanvas.TextFont = "Franklin Gothic, Verdana, Arial"
mycanvas.TextSize = 18
mycanvas.DrawText mytext, myparams
mycanvas.TextArea mytext, myparams, mywidth, myheight,
mylineheight
mycanvas.DrawShape "rect", "Operation=draw Pos=10,10 Size=" &
mywidth & "," & myheight
mycanvas.DrawShape "rect", "Operation=draw Pos=10,10 Size=" &
mywidth & "," & mylineheight
mycanvas.SaveAs Server.MapPath("textarea.jpg"),
"Quality=high"
The code above draws out a short piece of text onto a canvas.
After it has drawn it it measures the length of the text and draws
a box round it and around the first line. The image that is saved
is shown below.
textarea.jpg
|
|
|