home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1996 February
/
PCWK0296.iso
/
sharewar
/
os2
/
grafika
/
splot
/
demo
/
gsave.spt
< prev
next >
Wrap
Text File
|
1994-07-18
|
942b
|
51 lines
#include <splot.h>
int i;
double x,y,d,l;
main()
{
/* draw 3d stack of pages */
x = 5;
y = 15;
l = 4;
for (i = 0;i <= 10;i++;)
{
d = i * 0.2;
box(x - d ,y - d, x - d + l, y - d + l);
gsave();
set(LINECOLOUR,WHITE);
fill();
grestore();
stroke();
}
/* draw sample */
arc(5.02,14.96,1.2,0,360);
fill();
white_box(3.95,13.51,6.134,13.904);
white_box(3.862,13.689,3.752,15.443);
/* draw axes */
moveto(3.00,10.19);
rarrowto(0.0,2);
moveto(3.00,10.19);
rarrowto(2,0);
moveto(3.00,10.19);
rarrowto(1.6,1.6);
stroke();
/* add labels */
text(5.20,9.71,"X");
text(2.31,11.82,"Y");
text(5.01,11.64,"!l");
}
int white_box(double x1,double y1,double x2,double y2)
{
gsave();
newpath();
box(x1,y1,x2,y2);
set(LINECOLOUR,WHITE);
fill();
grestore();
}