# SDL Visual Test: C:/Users/DELL/Work/sdlvisualtest/visualtest/include/SDL_visualtest_screenshot.h File Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SDL_visualtest_screenshot.h File Reference
`#include "SDL_visualtest_process.h"`

Go to the source code of this file.

## Functions

int | SDLVisualTest_ScreenshotProcess (SDL_ProcessInfo *pinfo, char *prefix)
int | SDLVisualTest_ScreenshotDesktop (char *filename)
int | SDLVisualTest_VerifyScreenshots (char *args, char *test_dir, char *verify_dir)

## Detailed Description

Header for the screenshot API.

## Function Documentation

int SDLVisualTest_ScreenshotDesktop | ( | char * | filename) |  |

Takes a screenshot of the desktop and saves it into the file with path `filename`.

Returns
  1 on success, 0 on failure.

int SDLVisualTest_ScreenshotProcess | ( | SDL_ProcessInfo * | pinfo,
|  | char * | prefix
| ) |  |

Takes a screenshot of each window owned by the process `pinfo` and saves it in a file `prefix-i.png` where `prefix` is the full path to the file along with a prefix given to each screenshot.

Returns
  1 on success, 0 on failure.

int SDLVisualTest_VerifyScreenshots | ( | char * | args,
|  | char * | test_dir,
|  | char * | verify_dir
| ) |  |

Compare a screenshot taken previously with SUT arguments `args` that is located in `test_dir` with a verification image that is located in `verify_dir`.

Returns
  -1 on failure, 0 if the images were not equal, 1 if the images are equal and 2 if the verification image is not present.