Output Image
To create
an image file (or any of the devices supported by Gsharp) use the Output
Image option on the File menu.
Modify the Save
as type field to the format that you require. Specify a file name
and then click on Save.
GSL programmers can
control the output of images using the object hardcopy.
The following function
from $UNIDIR/lib/libhtml.gsl demonstrates this:
function make_image(float npx, float npy, string filename)
string type;
type = strrchr(filename,'.');
if type = '.gif' then
hardcopy.XuNdevice = 'ggifl8';
elif type = '.png' then
hardcopy.XuNdevice = 'gpngl8';
elif type = '.jpg' then
hardcopy.XuNdevice = 'gjpgi8';
elif type = '.tif' then
hardcopy.XuNdevice = 'gtifi8';
elif type = '.eps' then
hardcopy.XuNdevice = 'hcposteps';
else
echo('Unrecognised file extension: '+type);
return;
endif
hardcopy.XuNplotFileName = filename;
set page_1
( XuNlockToDevice = undef,
XuNformat = 'custom',
XuNsize = (npx,npy),
XuNmarginLeft = 0,
XuNmarginRight = 0,
XuNmarginTop = 0,
XuNmarginBottom = 0
);
print;
endfunction
|
Return to Gsharp Reference Manual.
|