ssCore.Desktop.saveImage

Save a rectangular area of the desktop to disk as a bitmap or Jpeg image.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

left - [Optional] - Left coordinate (in pixels) of area to be saved.

top - [Optional] - Top coordinate (in pixels) of area to be saved.

width - [Optional] - Width (in pixels) of area to be saved.

height - [Optional] - Height (in pixels) of area to be saved.

format - [Optional] - The format to use for saving the window image. The default is JPEG. Valid values include: bitmap and jpeg.

quality - [Optional] - Jpeg quality setting from 1 to 100 where 1 is the worst quality (best compression) and 100 is best quality (worst compression). The default is 90.

path - Full path of the file where the image should be saved. If the directory portion of the path does not exist the file will not be created. This parameter supports monikers.


Output Parameters:

No output parameters.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.Desktop.saveImage( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.Desktop.saveImage( paramsObject );


Notes:

Omit the top, left, width and height arguments to capture the entire dekstop.

You may want to use win.hide (and win.show) to avoid capturing all or part of your application window if it obscures part of the desktop you want to capture.


Examples:

ssCore.Desktop.saveImage({left:0, top:0, width:320, height:240, path:"startdir://snapshot.jpg"});