| transformpath |
(Matrix mtx) |
typedict.Path |
| |
Changes this path by applying the transformation
mtx
to every point currently stored in this path.
transformpath
changes the coordinates of the points stored in a path, but those points
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);
}
Matrix m = {
double sx = .5;
double sy = 2.0;
};
JFrame f = {
Color background = Color.white;
paint(Rectangle r) {
graphics { // "named block"
moveto(72, 72);
appendpath(p1);
transformpath(m);
appendpath(p2);
appendpath(p1);
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
transformpath.
| | |
| Return: |
Path
| | |
| See Also: |
appendpath,
Graphics,
rotatepath,
scalepath,
shearpath,
translatepath
|
|
Yoix is a registered trademark of AT&T Inc.
|