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
drawImage (Object obj, Image image, Number x, Number y) yoix.graphics
 
Draws image with its upper left corner at the point (x,y) 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).
 
 Example:   The program,
import yoix.*.*;

Image att = {
    String source = "http://www.yoix.org/imgs/ATTlogo.gif";
    Dimension size = {
        double height = 72.0;
        double width = 2.0*72.0;
    };
};

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

            paint(clip) {
                double x = size.width - att.size.width;
                double y = size.height - att.size.height;

                drawImage(this, att, x, y);
            }
        },
    };
};

frame.visible = TRUE;
sleep(5);
exit(0);
defines a paint function in a canvas that draws an image of the AT&T logo in the lower right corner of the canvas.
 
 See Also:   clearRect, copyArea, drawArc, 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.