| drawRoundRect |
(Object obj, Number x, Number y, Number w, Number h, Number hd, Number vd) |
yoix.graphics |
| |
Draws a rectangle with rounded corners 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, and has its upper left corner at the point
(x,y).
The horizontal and vertical diameters of the arcs at each corner
are controlled by the
hd
and
vd
arguments.
The rectangle 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;
Graphics graphics = {
Color foreground = Color.red;
};
paint(clip) {
drawRoundRect(this, 72, 2*72, 3*72, 72.0/4, 72.0/4, 72.0/8);
}
},
};
};
frame.visible = TRUE;
sleep(5);
exit(0);
defines a paint function in a canvas that draws a red rectangle with
rounded corners 3 inches wide and 1/4 inch high that is placed
1 inch from the left and 2 inches from the top of the canvas.
| | |
| See Also: |
clearRect,
copyArea,
drawArc,
drawImage,
drawLine,
drawOval,
drawPolygon,
drawPolyline,
drawRect,
drawString,
fillArc,
fillOval,
fillPolygon,
fillRect,
fillRoundRect,
pointInPolygon,
pointInRect,
rectContainsRect,
rectIntersectionRect,
rectIntersectsRect,
rectUnionRect,
stringBounds,
stringWidth
|
|
Yoix is a registered trademark of AT&T Inc.
|
|