Chapter Contents

Previous

Next
Widget Class: _snapShot

Widget Class: _snapShot



Copies a snapshot of a graphical widget into the Image Data Object


Syntax
Details

Syntax

objectName._snapShot( objectID );
objectName._snapShot( objectID, successful );
objectName._snapShot( objectID,successful, snapType );
objectName._snapShot( objectID, successful,snapType,upperLeftX );
objectName._snapShot( objectID, successful, snapType,upperLeftX,upperRightY );
objectName._snapShot( objectID, successful, snapType,upperLeftX,upperRightY, width );
objectName._snapShot( objectID, successful,snapType,upperLeftX, upperRightY, width, height );

Argument Type Use Description
objectID Numeric Input specifies the object identifier of the Image Data Object that is the target of the snapshot operation
successful Numeric Output returns whether or not the _snapshot method was successfully completed: 0 if successful
snapType Character Input specifies the type of snapshot operation: BOUNDED (default), UNBOUNDED or MAIN
upperLeftX Numeric Input specifies the the upper left x pixel coordinate for explicit bounding specification
upperRightY Numeric Input specifies the the upper right y pixel coordinate for explicit bounding specification
width Numeric Input specifies the the width in pxels for explicit bounding specification
height Numeric Input specifies the the height in pxels for explicit bounding specification


Details

An Image Data Object, which contains the results of the snapshot operation, must be provided. Not all objects will have a useful _snapshot image placed in the Image Data Object. Host widgets (such as push buttons and list boxes) are notable examples.

Example

The following example has a SAS/GRAPH Output object ( Original Graph) on the left half of the display and two Image objects ( Scaled and Unscaled) on the right half. The first Image object ( Scaled) has scaling enabled and the second Image object ( Unscaled) has scaling disabled. A radio box (snapType) contains the different snap_types. There is also a Graphic Text object nested in the SAS/GRAPH Output object that contains the string 'Texas'. When the radio box is selected, a new snapshot is created.

The following SCL code is used:

INIT:
 scaled._getDataId(scaledId);
 unscaled._getDataId(unscaledId);
return;

SNAPTYPE:
 graph._snapshot(scaledId, rc, snaptype); scaled._update();
 graph._snapshot(unscaledId, rc, snaptype); unscaled._update();
return;
Before selecting a snaptype, Original Graph is scrolled down and to the right so that parts of Montana and Idaho are in the upper left. Selecting Bounded from the radio box produces a snapshot.

Notice the Image object Scaled contains the entire picture visible in GRAPH, whereas Unscaled only contains the upper left portion. Both images contain parts of Montana and Idaho in the upper left.

When Unbounded is selected, Scaled contains the entire Grseg entry that GRAPH displays, whereas Unscaled contains only the upper left portion. Unbounded attempts to take a snapshot of the entire object, but only the upper left fits in Unscaled.

When Main is selected, you get results similar to Bounded except that nested objects are included in the snapshot. Notice the string 'Texas' appears in the snapshot images, whereas the string does not appear in the previous Bounded snapshot.


Chapter Contents

Previous

Next

Top of Page

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