Commands Used with the IMGCTRL, IMGOP and PICFILL Functions |
Syntax | |
Details | |
Examples |
Syntax |
rc = IMGOP(task-id, 'PRINT'<, x, y<, width, height<, type>>>); |
is the X coordinate (on the page) of the top left corner of the image.
Type: Numeric
is the Y coordinate (on the page) of the top left corner of the image.
Type: Numeric
specifies either the actual width in pixels or a scaling factor for the width.
Type: Numeric
specifies either the actual height in pixels or a scaling factor for the height.
Type: Numeric
specifies the type to convert the image to before the image is printed. You can specify one of the following:
CMAP |
color mapped image (maximum of 256 colors) |
GRAY |
gray-scale image |
MONOCHROME |
two-color (black and white) image |
RGBA |
true-color image. |
Type: Character
Details |
By default, PRINT centers the image. If you do not specify the width and height, PRINT fills the page.
If you want to specify either x or y, you must specify both. Also, if you want to specify either width or height, you must specify both. If you specify only one option in either of these pairs, PRINT uses the default values for both options in the pair. For example, if you specify the width but not the height, PRINT uses the default values for both the width and the height.
Use options x and y to position the image on the page. To center an image, specify -1 for the dimension in which you want to center the image (either x or y, or both). For example, if x is 0 and y is 999999, then the image will be printed in the lower left corner. If both x and y are 0, then the image will be printed in the upper left corner. If both x and y are -1, then the image will be printed in the center of the page.
To specify the actual width or height that you want to use to print the image, specify a positive number. To use the actual image size, specify 0 for both width and height. To scale the image, specify the scaling factor as a negative number. A scaling factor of -100 prints the image without scaling it up or down. A scaling factor of -150 is a scaling factor of 150 percent, and -50 is a scaling factor of 50 percent.
To keep the same aspect ratio, specify 0 for either width or height. For example, if you specify -75 for one option and 0 for the other, PRINT scales the image by 75 percent while keeping the same aspect ratio. You cannot specify 0 for both width and height.
If the scaling factor that you specify is larger than the easel, PRINT reduces the factor to the size of the easel. If the combination of options that you specify would position the image off the page, then the width and height options take priority, and the position is adjusted so that the image fits on the page.
Examples |
Position the image in the lower right corner:
rc=imgop(task-id,'PRINT',999999,999999);
Print the image in the center of the page and use the actual pixel size:
rc=imgop(task-id,'PRINT',-1,-1,-100,-100);
Scale the image up to fill the whole page:
rc=imgop(task-id,'PRINT',0,0,-99999,-99999);
Scale the image up by 150 percent:
rc=imgop(task-id,'PRINT',0,0,-150,-150);
Scale the width to 200 percent and keep the same aspect ratio:
rc=imgop(task-id,'PRINT',0,0,-200,0 );
Print the image with a width of 200 and keep the same aspect ratio:
rc=imgop(task-id,'PRINT',0,0,200,0);
Scale the width by 150 percent and use a height of 99:
rc=imgop(task-id,'PRINT',0,0,-150,99);
Fill in one direction and keep the same aspect ratio:
rc=imgop(task-id,'PRINT',0,0,99999,0);
Fill the page with the image:
rc=imgop(task-id,'PRINT',0,0,99999,99999);
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.