SaveSprite()

Syntax

Result = SaveSprite(#Sprite, Filename$ [, ImagePlugin [, Flags]])
Description
Saves the specified sprite to a file. By default, the saved image will be in 24-bit BMP format. Very useful for screenshots when used with the GrabSprite() function.

Parameters

#Sprite The sprite to save.
Filename$ The filename to use for the saved sprite.
ImagePlugin (optional) It can be one of the following constant:
  #PB_ImagePlugin_BMP     : Save the image in BMP  (default).
  #PB_ImagePlugin_JPEG    : Save the image in JPEG (the function UseJPEGImageEncoder() has to be used).
  #PB_ImagePlugin_JPEG2000: Save the image in JPEG2000 (the function UseJPEG2000ImageEncoder() has to be used).
  #PB_ImagePlugin_PNG     : Save the image in PNG  (the function UsePNGImageEncoder() has to be used).
Flags (optional) Additional control over saving for the specified plug-in. For now, only quality setting is supported: a number from 0 (worse quality) to 10 (maximum quality). Only the JPEG and JPEG 2000 plugins currently support it (default quality is set to '7' if no flags are specified).

Return value

Nonzero if the sprite has been successfully saved, zero otherwise.

See Also

LoadSprite()

Supported OS

All

<- RotateSprite() - Sprite Index - SpriteBlendingMode() ->