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

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,"\","test5");

  width  = 500;
  height = 500;

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

  * 0,0 -> ul  :  1,1 -> lr;
  cx = 0.55;
  cy = 0.45;

  r = max (cx, cy, 1-cx, 1-cy);

  n = 7;

  do i = 0 to n;
    f = i / n;

    w = 1 + 2 * r * (1-f) * width  ;
    h = 1 + 2 * r * (1-f) * height ;

    ulx = cx * width  - w/2 ;
    uly = cy * height - h/2 ;

    %setColorRGB ( 255 * (1-f) / 6
                    , 255 * f / 2.5
                    , 255 * f
                    );
    %fill3DRect (ulx,uly,w,h,0);
  end;

  %canvas_saveAs (gsf, gsftype, savedAs);

  %canvas_delete();

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