Displaying Images Using DSGI

Using the DATA Step Graphics Interface (DSGI), you can display an image in a designated position. To display an image, specify the file specification for the image file in quotation marks on the GDRAW('IMAGE',...) function.
This code displays the image in the screen coordinates (20, 20) to (40, 40). The last parameter, FIT, indicates how to display the image.
rc=gdraw("image",
"external-image-file", 20, 20, 40, 40,
"fit");
Image File Types Supported by SAS/GRAPH shows the supported image file formats.
goptions reset=all 
   ftext="Albany AMT/bold" htitle=1.25
   hsize=5.5in vsize=4.2in;
title "DSGI with Image";
data image;
   rc=ginit();
   rc=graph("clear");
  
rc=gdraw("image","external-image-file",
            5, 5, 90, 90,"tile");
   rc=graph("update");
   rc=gterm();
run;
quit;
If you specify the TILE keyword for the GDRAW('IMAGE',...) function, the image is copied as many times as needed to fill the specified area.
 rc=gdraw("image","external-image-file",
            5, 5, 90, 90,"tile");
DSGI with tiled image
If you specify the FIT keyword for the GDRAW('IMAGE',...) function, the image is stretched to fit within the entire area.
 rc=gdraw("image","external-image-file",
            5, 5, 90, 90,"fit");
DSGI with stretched image