| scalepath |
(Number sx, Number sy) |
typedict.Path |
| |
Changes this path by applying a horizontal scaling of
sx
and a vertical scaling of
sy
to every point currently stored in this path,
and returns this path to the caller.
We can talk about horizontal and vertical scaling because the coordinates
of the points in a path are always assumed to be stored in device space,
which closely matches the device-dependent coordinate system that Java
assigns to your screen.
| |
| Example: |
The program,
import yoix.*.*;
Path p1;
Path p2;
p1 { // "named block"
moveto(0, 0);
rlineto(72, 0);
rlineto(0, 36);
closepath();
rmoveto(72, 36);
}
p2 { // "named block"
moveto(0, 0);
rlineto(72, -36);
}
JFrame f = {
Color background = Color.white;
paint(Rectangle r) {
graphics { // "named block"
moveto(72, 72);
appendpath(p1);
appendpath(p2);
appendpath(p1);
scalepath(1, 2);
gsave();
setrgbcolor(0, 0, 1);
fill();
grestore();
setrgbcolor(1, 0, 0);
stroke();
}
}
};
f.visible = TRUE;
defines a paint function in a frame that fills and strokes a path that
is built from two separate paths using
appendpath
and
scalepath.
| | |
| Return: |
Path
| | |
| See Also: |
appendpath,
Graphics,
rotatepath,
shearpath,
transformpath,
translatepath
|
|
Yoix is a registered trademark of AT&T Inc.
|