Name
SaveSnapshot -- make a snapshot of the current screen (V2.0)
Synopsis
SaveSnapshot(f$[, mode, fmt, table])
Function
This function makes a snapshot and saves it as the file specified in f$. The mode argument specifies the area to be grabbed. This can be #SNAPWINDOW, which means that the Hollywood window will be grabbed (with borders), #SNAPDISPLAY, which means that only the display's contents will be grabbed or #SNAPDESKTOP, which means that the complete host screen will be grabbed. The fmt argument specifies the desired output format for the file (defaults to #IMGFMT_BMP which will save a 24-bit BMP picture).

Starting with Hollywood 2.5, you can also pass #IMGFMT_PNG as the format. SaveSnapshot() will then save the snapshot as a PNG picture.

Starting with Hollywood 4.0, you can also pass #IMGFMT_JPEG as the format. SaveSnapshot() will then save the brush as a JPEG picture. The Quality tag in the optional table argument allows you to specify the quality level for the JPEG image (valid values are 0 to 100 where 100 is the best quality).

Starting with Hollywood 4.5, you can also pass #IMGFMT_GIF and #IMGFMT_ILBM as format. If you use #IMGFMT_GIF, the snapshot will be saved as a GIF image. Because GIF images are always palette based, you can use the Colors and Dither tags of the optional table argument to specify the number of palette entries to allocate for the image and whether or not dithering shall be applied. If you choose #IMGFMT_ILBM, the snapshot will always be saved as a true color (24 bit) ILBM image.

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. Defaults to False which means no dithering.

Colors:
Specifies how many colors the image shall use. Again, this is only handled for palette-based formats. 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:

Please note that technically it is also possible to create palette-based BMP, PNG, and ILBM images. However, Hollywood currently does not support this and will always create true color (24 bit) images for these formats. This is why you cannot use the Dither and Colors tags for these formats currently.

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