Chapter Contents


Image Data Model: _print

Image Data Model: _print

Sets printing information for an image



CALL SEND (imgdat_id, '_print', <ulx,uly <, width, height <,type>>>);

Argument Type Description
ulx, uly
N the top left starting position of the image on the page.
width, height N the width and height to scale the image to on the page.
type C the type to convert the image to before printing. Values include:
MONOCHROME two-color black and white image
GRAY gray scale image
CMAP color-mapped image (256 max colors)
RGBA truecolor image


Image Positioning

If no positioning or sizing information is provided by the user, then the default information is used: the image is centered and the aspect ratio of the image is kept. If the Image Data Model is attached to an Image object, the image is scaled to the ratio of the displayed image. Otherwise, the actual pixel size is printed.

Argument Usage (ulx, uly and width, height)

Specified values are overwritten if you enter values that would position the image off the printer. You must specify these values in pairs (either two or four). If only the start position is specified, then the default behavior is used for sizing.

ulx and uly indicate the starting position of the image. -1 can be used to center the image. However, if the combination of width/height and start position would put it off the page, then size takes priority and position is adjusted so that the image fits.

Width and height indicate the image size. These can change the aspect ratio. Giving one of these values a zero keeps the aspect ratio. If both values are zero, the actual image size is assumed. Also, if the number given is larger than the easel, the image reduces to the easel size.

Negative numbers represent scaling factors. -100 is 100% of the actual image size, so the image is not scaled. -150 is 150% of the image, so the image is scaled upwards. -50 is 50% of the original image size.


The following examples use method arguments to achieve specific results:

To center an image:

CALL SEND (imgdat_id, '_print', -1, -1);

To start the image at the upper left corner:

CALL SEND (imgdat_id, '_print', 0, 0); 

To place the image in the lower right corner:

CALL SEND (imgdat_id, '_print', 999999, 999999);  

To place the image in the lower left corner:

CALL SEND (imgdat_id, '_print', 0, 999999);   

To print the actual image pixel size in the center of the page:

CALL SEND (imgdat_id, '_print', -1, -1, -100, -100);    

To fill the whole page with the image:

CALL SEND (imgdat_id, '_print', -0, -0, 99999, 99999);

To fill the whole page:

CALL SEND (imgdat_id, '_print', 0, 0, -99999, -99999);

To fill in one direction while keeping the aspect ratio:

CALL SEND (imgdat_id, '_print', 0, 0, 99999, 0);       

To scale the image by 1.5%:

CALL SEND (imgdat_id, '_print', 0, 0, -150, -150);

To scale the width to 200 and keep the aspect ratio:

CALL SEND (imgdat_id, '_print', 0, 0, 200, 0);         

To scale the width by 1.5 percent and set the height to 99:

CALL SEND (imgdat_id, '_print', 0, 0, -150, 99);          

The following would produce an error because the width and height cannot both be zero:

CALL SEND (imgdat_id, '_print', 0, 0, 0, 0);

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.