AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
stroke ([double alpha [, int clear]]) typedict.Graphics
 
Draws the current path on drawable using foreground and the optional alpha argument, which should be a number between 0.0 and 1.0 (the default), as the alpha value. The values assigned to linewidth, linecap, linejoin, miterlimit, dasharray, dashphase, and CTM when stroke is called are used to select the pixels that are actually painted when path is drawn. The path is automatically cleared after being drawn unless the optional clear argument in zero, but it can also be preserved using gsave and grestore.
 
 Example:   The program,
import yoix.*.*;

JFrame f = {
    paint(Rectangle r) {
        graphics {
            gsave();
            translate(144, 144);
            rotate(-15);
            scale(2, 2);
            moveto(0, 0);
            rlineto(72, 0);
            rlineto(-36, 72);
            rlineto(-36, 0);
            closepath();
            linejoin = JOIN_ROUND;
            linewidth = 9;
            scale(2, 1);    // try initmatrix()
            stroke();
            grestore();
        }
    }
};

f.visible = TRUE;
defines a paint function in a frame that creates a simple path that illustrates how fields like linewidth, linejoin, and CTM influence the results produced by stroke. This is an important example that you should experiment with. For example, remove the final scale or replace it with initgraphics and see if you understand what happens.
 
 Return:   none
 
 See Also:   clip, clippath, drawablebbox, eoclip, eoerase, eofill, erase, erasedrawable, fill, ineofill, infill, instroke, rectbutton, rectclip, rectcopy, recterase, rectfill, rectmove, rectstroke, strokepath

 

Yoix is a registered trademark of AT&T Inc.