
100 Chapter 3
•
•
•
•
Opacity - specifies opacity of the drawn object. The default value is 255 (completely
solid).
Unlock - if set to “true”, causes the line to display only where the specified color value
appears in the current (background) image. The default is false.
Color - specifies the color of the line.
Index - colorizes the line using the available color palette from the source image (as an
alternative to the Color parameter).
NOTE: You cannot specify values for both the Color and Index parameters.
Saturation - specifies a value used for weighting for the change in saturation for
destination pixels. A value of 255 changes the saturation of pixels to the specified color. A
value of 128 changes the saturation of a pixel to a mid-value between the pixel’s current
color and the specified color.
NOTE: The Saturation parameter only functions when the Blend parameter is set to
“colorize.”
PreserveAlpha - when set to “true”, preserves the alpha channel of the target image as
the alpha channel of the resulting image. The default is false.
Blend - specifies the type of blending used to combine the drawn object with the images.
Blend options are: “Normal”, “Darken”, “Lighten”, “Hue”, “Saturation”, “Color”,
“Luminosity”, “Multiply”, “Screen”, “Dissolve”, “Overlay,” “HardLight”, “SoftLight”,
“Difference”, “Exclusion”, “Dodge”, “ColorBurn”, “Under”, “Colorize” (causes only the
hue component of the source to be stamped down on the image), and “Prenormal”.
Width - specifies the thickness (in pixels) of the line. The default is 1.
Smooth - when set to “true”, makes the edges of the line smooth, preventing a pixellated
effect. The default is false.
Example
var image = new Media();
image.load(name @ "logobg.tga");
image.line(X1 @ 45, Y1 @ 15, X2 @ 135, Y2 @ 90, Width @ 3);
image.line(X1 @ 135, Y1 @ 60, X2 @ 135, Y2 @ 90, Width @ 3);
image.line(X1 @ 105, Y1 @ 90, X2 @ 135, Y2 @ 90, Width @ 3);
image.save(type @ "jpeg");