Chapter Contents

Previous

Next
IMGCTRL

IMGCTRL



Performs control operations on the Image window

Category: Image


Syntax
Commands Used with IMGCTRL
Details
Examples
Example 1: Using the WTITLE Command
Example 2: Using the WAIT Command
Example 3: Using the WRAISE Command
Example 4: Using the WSIZE Command
Example 5: Using the WTITLE and WRAISE Commands

Syntax

rc=IMGCTRL(task-id,command,<other-arguments>);

rc
contains the return code for the operation:
0 successful
>0 not successful

Type: Numeric

task-id
contains the identifier of the image task, which is returned by a previous IMGINIT function.

Type: Numeric

command
is the control command to be executed. Commands are described in Commands Used with IMGCTRL.

Type: Character

other-arguments
lists the argument(s) required with each command.

Type: Character or Numeric


Commands Used with IMGCTRL

'WAIT' seconds
specifies the amount of time to wait before executing the next command. Seconds specifies the number of seconds to wait.

'WRAISE'
attempts to force the Image window to the top while IMGOP or IMGCTRL commands are executing. This command may not be honored by some window managers. Note that the 'TOPWINDOW' option can be set at IMGINIT time to force the window to always be on top.

'WSIZE' width, height <xpos, ypos>
specifies the width and height of the Image window in pixels. It optionally positions the window at xpos and ypos of the top left corner. Some window managers may not support positioning.

'WTITLE'title'
specifies a title for the Image window. The specified title appears in parentheses after 'SAS: IMAGE'.


Details

IMGCTRL enables you to control the Image window. It includes, for example, commands to assign a window title and set the window size.


Examples

Example 1: Using the WTITLE Command

Extract the name of the IMAGE entry and then use the WTITLE command to assign that name to the window:

path=lnamemk(5,catname,'format=cat');
rc=lnameget(path,type,name,form);
gname=scan(name,3,'.');
rc=imgop(taskid,'READ',path);
rc=imgctrl(taskid,'WTITLE',gname);
rc=imgop(taskid,'PASTE',1,1);

Example 2: Using the WAIT Command

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);

Example 3: Using the WRAISE Command

Force the Image window to the top:

pop:
   rc=imgctrl(taskid,'WRAISE');
return;

Example 4: Using the WSIZE Command

Make the Image window match the size of the image that is being displayed:

height=0;
width=0;
rc=imgop(taskid,'READ',path);
rc=imgop(taskid,'QUERYN','WIDTH',iwidth);
rc=imgop(taskid,'QUERYN','HEIGHT',iheight);
rc=imgctrl(taskid,'WSIZE',iwidth,iheight);
rc=imgop(taskid,'PASTE',1,1);

Example 5: Using the WTITLE and WRAISE Commands

Change the window title and then force the Image window to the top:

path=lnamemk(5,catname,'format=cat');
rc=lnameget(path,type,name,form);
gname=scan(name,3,'.');
rc=imgop(taskid,'READ',path);
rc=imgctrl(taskid,'WTITLE',gname);
rc=imgop(taskid,'PASTE',1,1);
rc=imgctrl(taskid,'WRAISE');


Chapter Contents

Previous

Next

Top of Page

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