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
drawArc (Object obj, Number x, Number y, Number w, Number h, Number a, Number da) yoix.graphics
 
Draws the arc of the largest ellipse that fits inside the rectangle in obj, which must be an Image or a drawable component (i.e., a Swing or AWT component, like a JCanvas, JFrame, or Canvas, that supports a paint function), that is w units wide, h units high, has its upper left corner at the point (x,y), starts at angle a and ends at angle a+da. Angles are interpreted in degrees and the arc extends in the counter-clockwise direction when da is greater zero. The arc is drawn in the foreground color selected by the Graphics object associated with obj.
 
 Example:   The program,
import yoix.*.*;

JFrame frame = {
    Array layout = {
        new JCanvas {
            Color background = Color.black;

            paint(clip) {
        	graphics.foreground = Color.red;
        	drawRect(this, 72, 72, 3*72, 2*72);
        	graphics.foreground = Color.yellow;
        	drawArc(this, 72, 72, 3*72, 2*72, 30, 90);
            }
        },
    };
};

frame.visible = TRUE;
sleep(5);
exit(0);
defines a paint function in a canvas that draws a red rectangle 3 inches wide and 2 inches high that is placed 1 inch from the left and 1 inch from the top of the canvas and then draws a yellow arc inside that rectangle that extends from 30 to 120 degrees.
 
 See Also:   clearRect, copyArea, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, pointInPolygon, pointInRect, rectContainsRect, rectIntersectionRect, rectIntersectsRect, rectUnionRect, stringBounds, stringWidth

 

Yoix is a registered trademark of AT&T Inc.