예제 #1
0
int main(int argc,char *argv[]) {

  struct PostScript *ps=NULL;
  struct PostScriptDash *dash=NULL;

  float p[3]={5,2,3};


  float wdt=400,hgt=400;
  float xoff=50,yoff=50;

  unsigned int fgcol=0xff000000;

  ps=PostScriptMake();
  PostScriptSetText(ps,stream,stdout);   
  PostScriptMakePlot(ps,xoff,yoff,wdt,hgt,0);

  dash=PostScriptMakeDash(p,0,3);

  
  PostScriptRectangle(ps,NULL,10,10,wdt-20,hgt-20,
                      0,fgcol,0,dash,NULL);

  PostScriptFreeDash(dash);

  

  PostScriptEndPlot(ps);
  return 0;
}
예제 #2
0
int main(int argc,char *argv[]) {

  struct PostScript *ps=NULL;

  float wdt=400,hgt=400;
  float xoff=50,yoff=50;

  unsigned int fgcol=0xff000000;

  int x;

  ps=PostScriptMake();
  PostScriptSetText(ps,stream,stdout);   
  PostScriptMakePlot(ps,xoff,yoff,wdt,hgt,0);


  for (x=10;x<200;x+=10) {
    PostScriptRectangle(ps,NULL,x,x,wdt-2*x,hgt-2*x,
                   0,fgcol,0,NULL,NULL);
  }
 

 
  PostScriptEndPlot(ps);
  return 0;
}
예제 #3
0
int main(int argc,char *argv[]) {

  struct PostScript *ps=NULL;
  struct PostScriptMatrix m;
 
  float wdt=400,hgt=400;
  float xoff=50,yoff=50;

  unsigned int fgcol=0xff000000;

  ps=PostScriptMake();
  PostScriptSetText(ps,stream,stdout);   

  PostScriptMakeDocument(ps,xoff,yoff,wdt,hgt,0);
  PostScriptMakePlot(ps);

  m.a=1.0;
  m.b=0.0;
  m.c=0.0;
  m.d=1.0;

  PostScriptScaleMatrix(&m,0.5,0.8);

  PostScriptRectangle(ps,&m,wdt/2,hgt/2,wdt/4,hgt/4,
                   0,fgcol,0,NULL,NULL);




  PostScriptEndPlot(ps);
  PostScriptEndDocument(ps);
  return 0;
}
예제 #4
0
int main(int argc,char *argv[]) {

  struct PostScript *ps=NULL;
  struct PostScriptClip *clip=NULL;

  float wdt=400,hgt=400;
  float xoff=50,yoff=50;

  unsigned int fgcol=0xff000000;

  float x[4]={0,200,400,200};
  float y[4]={200,0,200,400};
  int t[4]={0,0,0,0};


  ps=PostScriptMake();
  PostScriptSetText(ps,stream,stdout);   
  PostScriptMakePlot(ps,xoff,yoff,wdt,hgt,0);

  clip=PostScriptMakeClip(50,50,wdt,hgt,4,x,y,t);

  PostScriptRectangle(ps,NULL,10,10,wdt-20,hgt-20,
                  1,fgcol,0,NULL,clip);

  PostScriptFreeClip(clip);
  

  PostScriptEndPlot(ps);
  return 0;
}
예제 #5
0
int main(int argc,char *argv[]) {

  struct PostScript *ps=NULL;

  float wdt=400,hgt=400;
  float xoff=50,yoff=50;

  unsigned int fgcol=0xff000000;

  ps=PostScriptMake();
  PostScriptSetText(ps,stream,stdout);   
  PostScriptMakeDocument(ps,xoff,yoff,wdt,hgt,0);
  PostScriptMakePlot(ps);

  PostScriptRectangle(ps,NULL,10,10,wdt-30,hgt-30,
                  1,fgcol,0,NULL,NULL);

  PostScriptEndPlot(ps);
  PostScriptEndDocument(ps);
  return 0;
}
예제 #6
0
int main(int argc,char *argv[]) {

  char *text="Hello world!";
 
  struct PostScript *ps=NULL;

  float wdt=400,hgt=400;
  float xoff=50,yoff=50;

  unsigned int fgcol=0xff000000;

  ps=PostScriptMake();
  PostScriptSetText(ps,stream,stdout);   
  PostScriptMakePlot(ps,xoff,yoff,wdt,hgt,0);

  PostScriptText(ps,NULL,"Helvetica",34.0,20,50,
            strlen(text),text,fgcol,NULL);




  PostScriptEndPlot(ps);
  return 0;
}