jDSGI - Java2D DATA Step Graphics Interface |
Back
-
Next
[ 9 of 27 ]
|
|
|
by Richard A. DeVenezia, Copyright 2004 |
HOME |
|
/*
* Richard A. DeVenezia
* June 1, 2004
*
* jDSGI test 9
*/
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,"\","test9");
width = 500;
height = 500;
%canvas (_g, width, height, 0ffffffx)
%createBuffer (width, height);
%setColor (0ffffffx);
%fillRect (0,0,width,height);
%setColor (0333333x);
%drawLine (0,0,width,height);
%drawString ("Clipping is off", 25,25);
ulx = width / 4;
uly = height / 4;
w = width / 2;
h = height / 2;
%setClip (ulx, uly, w, h);
%drawLine (0,height,width,0);
do i = 1 to 15;
%drawString ("Clipping is in effect", ulx+(i-3)*20-45, uly+h-(i-3)*20);
end;
%canvas_saveAs (gsf, gsftype, savedAs);
declare javaobj bounds ("jdsgi/DoubleArray");
%getClipBounds (bounds);
bounds.callIntMethod ('getLength', n);
put 'clip bounds:';
do i = 1 to n;
bounds.callDoubleMethod ('get', i-1, d);
put i= d=;
end;
bounds.delete();
%canvas_delete();
if savedAs ne '' then call system ("start " || savedAs);
run;