|
|
Font
The Font object defines the look of text applied to an image using the
DrawTextOnImage method. To set
a Font object, use,
Set objFont = objImagegen.Font
Font Properties
| Font Properties |
| Color |
Sets or returns the color of text on an image. The font color is black by default.
Example:
Set objImageGen = Server.CreateObject("softartisans.ImageGen")
objImageGen.CreateImage 500, 500, rgb(255,255,204)
Set objFont = objImagegen.Font
objFont.Color = rgb(221,0,0)
objImageGen.DrawTextOnImage 50, 50, 300, 1, "Text"
Top |
| FontFamily |
Sets or returns a font family to use, if the assigned font
(see Name) is not available on the server running ImgWriter.
Assign FontFamily by
name or number, according to the following table.
| saiDefault | 0 | saiModern | 3 |
| saiRoman | 1 | saiScript | 4 |
| saiSwiss | 2 | saiDecorative | 5 |
Top |
| Height |
Sets or returns letter height.
Example:
Set objImageGen = Server.CreateObject("softartisans.ImageGen")
objImageGen.CreateImage 500, 500, rgb(255,255,204)
set objFont = objImagegen.font
objFont.height = 14
objImageGen.DrawTextOnImage 50, 50, 300, 1, "Text"
Top |
| Italic |
Set to True to display italic text on an image.
Italic is set to False by default.
Example:
Set objImageGen = Server.CreateObject("softartisans.ImageGen")
objImageGen.CreateImage 500, 500, rgb(255,255,204)
set objFont = objImagegen.font
objFont.italic = True
objImageGen.DrawTextOnImage 50, 50, 300, 1, "Text"
Top |
| Orientation |
Sets or returns text orientation
as the angle, in tenths of degrees, between displayed text strings
and the x-axis. To rotate text clockwise, set Orientation to a
negative value. To rotate text counter-clockwise, set Orientation
to a positive value.
Example:
Set objImageGen = Server.CreateObject("softartisans.ImageGen")
objImageGen.LoadImage "D:\images\olivetrees.jpg"
Set objFont = objImageGen.Font
objFont.orientation = 450
objImageGen.DrawTextOnImage 10, 50, 100, 50, "orientation"
Top |
| Name |
Sets or returns the name of the font to display on
an image.
Example:
Set objImageGen = Server.CreateObject("softartisans.ImageGen")
objImageGen.CreateImage 500, 500, rgb(255,255,204)
set objFont = objImagegen.font
objFont.name = "verdana"
objImageGen.DrawTextOnImage 50, 50, 300, 1, "Text"
Top |
| StrikeOut |
Set to True to display font with a line through it.
Example:
Set objImageGen = Server.CreateObject("softartisans.ImageGen")
objImageGen.CreateImage 500, 500, rgb(255,255,204)
set objFont = objImagegen.font
objFont.strikeout = True
objImageGen.DrawTextOnImage 50, 50, 300, 1, "Text"
Top |
| Underline |
Set to True to display underlined text.
Set objImageGen = Server.CreateObject("softartisans.ImageGen")
objImageGen.CreateImage 500, 500, rgb(255,255,204)
set objFont = objImagegen.font
objFont.underline = True
objImageGen.DrawTextOnImage 50, 50, 300, 1, "Text"
Top |
| Weight |
Sets or returns font weight. Weight is set to
0 by default. Increase the value of weight to display bold text.
Example:
Set objImageGen = Server.CreateObject("softartisans.ImageGen")
objImageGen.CreateImage 500, 500, rgb(255,255,204)
set objFont = objImagegen.font
objFont.weight = 700
objImageGen.DrawTextOnImage 50, 50, 300, 1, "Text"
Top |
| Width |
Sets or returns letter width.
Example:
Set objImageGen = Server.CreateObject("softartisans.ImageGen")
objImageGen.CreateImage 500, 500, rgb(255,255,204)
set objFont = objImagegen.font
objFont.width = 7
objImageGen.DrawTextOnImage 50, 50, 300, 1, "Text"
Top |
Copyright © 2001-2004, SoftArtisans, Inc.
|