Name
SaveSnapshot -- take a snapshot (V2.0)
Synopsis
SaveSnapshot(f$[, mode, fmt, table])
Function
This function takes a snapshot and saves it as the file specified in f$. The mode argument specifies the area to be grabbed. This can be one of the following constants:

#SNAPWINDOW:
Grabs the complete Hollywood display, i.e. with window decorations. This is the default.

#SNAPDISPLAY:
Grabs the display's contents only, i.e. without window decorations.

#SNAPDESKTOP:
Grabs the complete host screen.

Note that if the display is a palette mode display and you want the image file to be palette-based as well, you need to use #SNAPDISPLAY as this is the only snap mode that doesn't contain any other graphics besides the display's contents.

The fmt argument specifies the desired output image format. This can either be one of the following constants or an image saver provided by a plugin:

#IMGFMT_BMP:
Windows bitmap. Hollywood's BMP saver supports RGB and palette images. #IMGFMT_BMP is the default format used by SaveSnapshot().

#IMGFMT_PNG:
PNG format. Hollywood's PNG saver supports RGB and palette images. RGB images also can have an alpha channel, palette images can have a transparent pen. (V2.5)

#IMGFMT_JPEG:
JPEG format. Note that the JPEG format does not support alpha channels or palette-based graphics. The Quality field (see below) allows you to specify the quality level for the JPEG image (valid values are 0 to 100 where 100 is the best quality). (V4.0)

#IMGFMT_GIF:
GIF format. Because GIF images are always palette-based, RGB graphics have to be quantized before they can be exported as GIF. You can use the Colors and Dither tags (see below) to specify the number of palette entries to allocate for the image and whether or not dithering shall be applied. When using #IMGFMT_GIF with a palette display, no quantizing will be done. #IMGFMT_GIF also supports palette images with a transparent pen. (V4.5)

#IMGFMT_ILBM:
IFF ILBM format. Hollywood's IFF ILBM saver supports RGB and palette images. Palette images can also have a transparent pen, alpha channels are unsupported for this output format. (V4.5)

The optional table argument allows you to configure further parameters:

Dither:
Set to True to enable dithering. This tag is only handled when the destination format is palette-based and the source data is RGB. Defaults to False which means no dithering.

Depth:
Specifies the desired image depth. This is only handled when the format is palette-based and the source data is RGB. Valid values are between 1 (= 2 colors) and 8 (= 256 colors). Defaults to 8. (V9.0)

Colors:
This is an alternative to the Depth tag. Instead of a bit depth, you can pass how many colors the image shall use here. Again, this is only handled for palette-based formats when the source data is RGB. Valid values are between 1 and 256. Defaults to 256.

Quality:
Here you can specify a value between 0 and 100 indicating the compression quality for lossy compression formats. A value of 100 means best quality, 0 means worst quality. This is only available for image formats that support lossy compression. Defaults to 90 which means pretty good quality.

Here is an overview that shows which formats support which tags:

Inputs
f$
destination file
mode
optional: specifies which area shall be grabbed (defaults to #SNAPWINDOW)
fmt
optional: output format; either #IMGFMT_BMP, #IMGFMT_PNG, (V2.5) #IMGFMT_JPEG, #IMGFMT_GIF or #IMGFMT_ILBM (V4.0) (defaults to #IMGFMT_BMP)
table
optional: table argument for configuring further options (V4.5)
Example
SaveSnapshot("Snap.bmp")
Saves a snapshot of the Hollywood window to "Snap.bmp".

Show TOC