
110 Chapter 3
•
•
•
•
Other Style parameters are “Underline”, “Italic” or “Italics”, and “Strikethru” or
“Strikeout”).
NOTE: You can combine Style parameters. For example: Style @ “Bold Italic”
Text - specifies the text to be drawn. The text string must be enclosed in quotes. To indicate
a line break, insert \n into the text.
Size - sets the point size of the font to be used. The default size is 12.
Spacing - adjusts the spacing between the text characters. The default is 0.
NOTE: A negative Spacing value draws the text characters closer together.
Smooth - specifies that the text is drawn with five-level anti-aliasing.
ClearType - if specified as “true”, the Windows ClearType text renderer will be used if
available.
Kern - if set to “true”, optimizes the spacing between text characters. By default this is set
to true. If you do not want to use kerning, this must be specified as false.
NOTE: PostScript fonts store the Kerning information in a separate file with a .afm extension. This
file must be present in order for kerning to be applied to the text.
noiseAddNoise()
Applies random pixels to an image to simulate a noise effect.
NOTE: This function is “selection aware,” so that if a selection has been made, the system applies
it based on the current selection. For more information about making selections, see “selection()” on
page 129.
Syntax
image.noiseAddNoise(
[Amount @ <value 1..999>]
[Gaussian @ <true, false>]
[Grayscale @ <true, false>]
);
Parameters
Amount - indicates the intensity of the effect. The default is 32.
Gaussian - toggles the Gaussian distribution effect on or off. The default is false (off).
Grayscale - applies the monochromatic scale to the affected pixels. The default is false
(normal color).
Example
var image = new Media();
image.load(name @ "peppers.tga");
image.noiseAddNoise(Amount @ 15, Gaussian @ true, Grayscale @ true);
image.save(type @ "jpeg");