| erase |
([double alpha]) |
typedict.Graphics |
| |
Fills the current
path
on
drawable
by painting the interior, which is identified using the non-zero winding rule,
using
drawable's
background
color and the optional
alpha
argument, which should be a number between
0.0
and
1.0,
as the alpha value.
The
path
is automatically cleared after being filled, but it can be preserved
using
gsave
and
grestore.
| |
| Example: |
The program,
import yoix.*.*;
JFrame f = {
Color background = Color.red;
paint(Rectangle r) {
graphics { // "named block"
gsave();
rectclip(r);
setgray(0); // black
rectfill(r);
translate(144, 144);
moveto(0, -50);
lineto(29, 40);
lineto(-47, -15);
lineto(47, -15);
lineto(-29, 40);
closepath();
gsave();
erase();
grestore();
setrgbcolor(0, 1, 0);
stroke();
grestore();
}
}
};
f.visible = TRUE;
defines a paint function in a frame that fills the frame with black,
creates a path that looks like a star, erases it using
erase,
and then draws the outline in green.
Notice how we surrounded
erase
with an extra
gsave
and
grestore,
which preserved the path so we could draw the outline using
stroke.
| | |
| Return: |
none
| | |
| See Also: |
clip,
clippath,
drawablebbox,
eoclip,
eoerase,
eofill,
erasedrawable,
fill,
ineofill,
infill,
instroke,
rectbutton,
rectclip,
rectcopy,
recterase,
rectfill,
rectmove,
rectstroke,
stroke,
strokepath
|
|
Yoix is a registered trademark of AT&T Inc.
|