# screenshot.cpp File Reference

The creation of screenshots! More...

`#include "stdafx.h"`
`#include "openttd.h"`
`#include "fileio_func.h"`
`#include "viewport_func.h"`
`#include "gfx_func.h"`
`#include "screenshot.h"`
`#include "variables.h"`
`#include "blitter/factory.hpp"`
`#include "zoom_func.h"`
`#include "core/alloc_func.hpp"`
`#include "core/endian_func.hpp"`
`#include "map_func.h"`
`#include "saveload/saveload.h"`
`#include "company_func.h"`

Go to the source code of this file.

## Data Structures
struct | ScreenshotFormat
struct | BitmapFileHeader
struct | BitmapInfoHeader
struct | RgbQuad
struct | PcxHeader
## Typedefs
typedef void | ScreenshotCallback (void *userdata, void *buf, uint y, uint pitch, uint n)
typedef bool | ScreenshotHandlerProc (const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette)
## Functions
| assert_compile (sizeof(BitmapFileHeader)==14)
| assert_compile (sizeof(BitmapInfoHeader)==40)
| assert_compile (sizeof(RgbQuad)==4)
static bool | MakeBmpImage (const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette)
| assert_compile (sizeof(PcxHeader)==128)
static bool | MakePCXImage (const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette)
void | InitializeScreenshotFormats ()
const char * | GetScreenshotFormatDesc (int i)
void | SetScreenshotFormat (int i)
static void | CurrentScreenCallback (void *userdata, void *buf, uint y, uint pitch, uint n)
static void | LargeWorldCallback (void *userdata, void *buf, uint y, uint pitch, uint n)
| generate a large piece of the world
static char * | MakeScreenshotName (const char *ext)
void | SetScreenshotType (ScreenshotType t)
bool | IsScreenshotRequested ()
static bool | MakeSmallScreenshot ()
static bool | MakeWorldScreenshot ()
bool | MakeScreenshot ()
## Variables
char | _screenshot_format_name [8]
uint | _num_screenshot_formats
uint | _cur_screenshot_format
ScreenshotType | current_screenshot_type
struct BitmapFileHeader | GCC_PACK
static const ScreenshotFormat | _screenshot_formats []

## Detailed Description

The creation of screenshots!

Definition in file screenshot.cpp.

## Function Documentation

static void LargeWorldCallback | ( | void * | userdata,
|  | void * | buf,
|  | uint | y,
|  | uint | pitch,
|  | uint | n |
| ) |  |  | `[static]`

generate a large piece of the world

Parameters:

  | userdata | Viewport area to draw
  | buf | Videobuffer with same bitdepth as current blitter
  | y | First line to render
  | pitch | Pitch of the videobuffer
  | n | Number of lines to render

Definition at line 492 of file screenshot.cpp.

References _screen_disable_anim, ViewPort::left, min(), ScaleByZoom(), ViewPort::top, ViewPort::virtual_left, ViewPort::virtual_top, ViewPort::width, and ViewPort::zoom.

## Variable Documentation

const ScreenshotFormat _screenshot_formats[]`[static]`

Initial value:

     {

      {"BMP", "bmp", &MakeBmpImage},
      {"PCX", "pcx", &MakePCXImage},
    }

Definition at line 445 of file screenshot.cpp.