Commands Used with the IMGCTRL, IMGOP and PICFILL Functions |
Syntax | |
Details | |
Examples |
Syntax |
rc=IMGOP(task-id, 'READ', image-path<, attributes>); |
rc=IMGOP(task-id, 'READ', driver, 'DEVICE=type<attributes>'); |
is either the pathname of the external file that contains the image or the path string that is returned by the LNAMEMK function.
Currently only the TWAIN driver is supported (and only on the Windows operating environment). If you specify a driver, then you must use the DEVICE= attribute to indicate the type of device.
the type of device: SCANNER or CAMERA
are file- or device-specific attributes. See Attributes for Reading Image Files for possible choices.
Details |
READ acts on the currently selected image. You can specify the file directly (using its physical filename path), or use the information returned by a previous LNAMEMK function call. The LNAMEMK function creates a single character variable that contains information about the location of the image (even if it resides in a SAS catalog), as well as other image attributes.
The FORMAT= attribute must be specified for Targa images, for images that reside in SAS catalogs, and for host-specific formats. FORMAT is not required in other cases, but it is always more efficient to specify it.
Examples |
Read an image that is stored in a SAS catalog:
path=lnamemk(5,'sashelp.imagapp.gfkids','format=cat'); rc=imgop(task-id,'READ',path);
Specify a file in the READ command:
rc=imgop(task-id,'READ','/usr/images/color/sign.gif');
rc=imgop(task-id,'READ','twain','device=scanner dpi=100');
Read from a camera:
rc=imgop(task-id,'READ','twain','device=camera');
Read a Portable Networks Graphics image:
rc=imgop(taskid,'READ','/images/test.png','format=PNG');
Read an image and wait 5 seconds before displaying the image after each PASTE command:
rc=imgop(taskid,'READ',path); rc=imgop(taskid,'PASTE'); rc=imgctrl(taskid,'WAIT',5); rc=imgop(taskid,'READ',path2); rc=imgop(taskid,'PASTE'); rc=imgctrl(taskid,'WAIT',5);
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.