VOutputSaveScreenImage
Name
VOutputSaveScreenImage - saves a screen image to a file.
Synopsis
VOutputSaveScreenImage(scrn_file, xloc, yloc, width, height, opt)
char *scrn_file;
int xloc, yloc;
int width, height;
int opt;
Description
VOutputSaveScreenImage saves a screen image to a file. If opt is equal to
1, VOutputSaveScreenImage checks whether the specified file exists. If the
file exists, VOutputSaveScreenImage appends the specified data to the end of
the file, else it creates the file and writes the data to the file. If opt
is equal to 0, VOutputSaveScreenImage overwrites the specified file if it
exists, else it creates the file and writes the data to the file. The screen
file contains the number of frames in the first 4 bytes, followed by
the contents of the frames. Each frame contains the image, the number of
colormap entries, and the colormap contents.
Return Value
0 - work successfully.
1 - memory allocation error.
2 - read error.
3 - write error.
5 - improper file seek.
Parameters
scrn_file - specifies the name of the file to be saved.
xloc, yloc - specifies x and y coordinates of the upper left corner of the
rectangle, relative to the origin of the image window.
width, height - specifies the width and height in pixels of image to
be output.
opt - specifies the flag to indicate either append a screen to a file or
overwrite the file. 1 - append; 0 - overwrite.
Side Effects
None.
Entry Conditions
If xloc, yloc, width, height or opt is not valid or scrn_file is NULL, or
VCreateColormap was not called earlier, VOutputSaveScreenImage prints an error
message to the standard error stream, produces a core dump file and exits
from the current process.
Related Funtions
VEraseSaveScreenCommand,
VGetSaveScreenSwitchValue,
VGetSaveScreenFilename,
VCheckEventsInButtonWindow,
VDisplaySaveScreenCommand,
VDisplaySaveScreenImage.