jDSGI - Java2D DATA Step Graphics Interface
  Back - Next   [ 21 of 27 ]
image  
by Richard A. DeVenezia, Copyright 2004  HOME
/*
 * Richard A. DeVenezia
 * June 11, 2004
 *
 * jDSGI test 21
 */

data _null_;

  if symexist('goutpath') then goutpath=symget('goutpath'); else goutpath=pathname('WORK');
  if symexist ('gsftype') then gsftype=symget('gsftype'); else gsftype='png';

  gsf = cats(goutPath,"\","test21");

  width  = 500;
  height = 500;

  %canvas (_g, width, height, 0ffffffx)

  %tsetWindow (1,-1,-1,7,4);

  array px[10] _temporary_ ( 0,1,1,1,1,1,1,-2,-1,-1 );
  array py[10] _temporary_ ( 1,1,0,1,-1,0,-1,0,-1,1 );

  do i = 2 to dim (px);
    px [i] = px[i-1] + px[i];
    py [i] = py[i-1] + py[i];
  end;

  %setColor (336699x);
  %setPenWidth(12);
  %setPenEndCap (&CAP_BUTT);
  %setPenLineJoin (&JOIN_ROUND);

  step = 0.125;
  do r = step to 2 by step;
    %tsetViewport (1, .5-r,.5-r,.5+r,.5+r);
    %tpolygon (px,py);
  end;

  %canvas_saveAs (gsf, gsftype, savedAs);

  %canvas_delete();

  if savedAs ne '' then rc = system ("start " || savedAs);
run;