Sample 31167: How to Determine the Size of an Image File by Using the IMGOP Function
The IMGOP function, available in the SAS Component Language (SCL), can be used to manipulate and retrieve information about an image file.
The following SCL code shows how the IMGOP function can be used to return the height and width in pixels of a particular image file.
init:
/* Initialize the command lists */
cmdid = makelist();
allcmdid=makelist();
rc = insertl(allcmdid,cmdid,-1);
/* Create the image task, but do not display the image */
taskid = imginit(allcmdid,'nodisplay');
/* Load the image using the task */
rc=imgop(taskid,'READ','c:\myImageFile.jpg');
/* Initialize the height and width variables */
declare num height = 0;
declare num width = 0;
/* Retrieve the number of pixels for the image's height and width */
rc=imgop(taskid,'QUERYN','HEIGHT',height);
rc=imgop(taskid,'QUERYN','WIDTH',width);
/* Write the height and width values to the SAS log */
put height= width=;
return;
|
Additional Documentation
Documentation for additional functionality available with the IMGOP function can be found in the SAS Component Language 9.1: Reference.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
The IMGOP function, available in the SAS® Component Language (SCL), can be used to manipulate and retrieve information about an image file.
Type: | Sample |
Topic: | SAS Reference ==> SCL (SAS Component Language)
|
Date Modified: | 2008-03-19 11:01:56 |
Date Created: | 2008-02-12 15:17:11 |
Operating System and Release Information
SAS System | SAS/AF | Microsoft Windows Server 2003 Datacenter Edition | | |
64-bit Enabled HP-UX | | |
Microsoft Windows 2000 Professional | | |
Microsoft Windows NT Workstation | | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
Solaris | | |
OpenVMS on HP Integrity | | |
OS/2 | | |
Microsoft Windows 95/98 | | |
Microsoft Windows 2000 Advanced Server | | |
Microsoft® Windows® for x64 | | |
Microsoft Windows Server 2003 Enterprise Edition | | |
OpenVMS VAX | | |
Microsoft Windows 2000 Server | | |
Linux on Itanium | | |
64-bit Enabled Solaris | | |
Solaris for x64 | | |
Microsoft Windows 2000 Datacenter Server | | |
z/OS | | |
HP-UX IPF | | |
Tru64 UNIX | | |
OpenVMS Alpha | | |
Windows Millennium Edition (Me) | | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
Windows Vista | | |
64-bit Enabled AIX | | |
Microsoft Windows Server 2003 Standard Edition | | |
Microsoft Windows XP Professional | | |
Microsoft Windows XP 64-bit Edition | | |
HP-UX | | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
ABI+ for Intel Architecture | | |
AIX | | |
IRIX | | |
Linux | | |