plfill
fill and/or stroke current path
parameter | type | units | description |
---|---|---|---|
-- | void | -- | -- |
returns: | void |
Description
plfill fills the current path using the current fill color and then strokes it using the current stroke color. For filling of complex paths, the non-zero winding rule is applied. The current path is the most recent uninterrupted series of pen movements, either with the pen up or with the pen down. Interruptions in that path are normally caused by many simplot calls such as color changes, (non-stroked) text plotting or program exit. Those interruptions cause the current path to be stroked.Examples
The following example plots two stroked rectangles, each with its own fill color and then plots two circles in opposite directions but as a single path. By opposing the directions, the path is effectively a ring. For the rectangles, filling is performed using plset(RECTFILL,TRUE). Plfill cannot be used here, since rectangle are plotted using special PostScript commands, not by explicit pen movements.#include <simplot.h> void pldraw(void) { plcolor(OliveDrab); plmess("plfill\n"); if (plget(PLOTTER)==X) { plcolor(Magenta); plu(-5,-5); plformat(0.5,-.5,"Type q to quit"); } plcolor(Black); plfcolor(Salmon); plrect(0,0,70,70); plfcolor(LightBlue); plrect(40,40,80,80); plset(PENDIA,1); plfcolor(Gold); plcolor(OliveDrab); plarc(35,35,20,0,-360,DOWN); plarc(35,35,10,0,360,DOWN); plfill(); plframe(5,3); } int main(int argc,char *argv[]) { // without an argument, make a PS file and quit; use X otherwise plinit(argc==1 ? PS : X,"plfill",105,105,15,15,"",""); plset(HEIGHT,4); plset(PENDIA,2); plset(RECTFILL,TRUE); plloop(); exit(0); }