version 3
COMPRESS PICTURE FILE (document; method; quality)
Parameter | Type | Description | |
document | DocRef | Document reference number | |
method | String | 4-character string compression method | |
quality | Number | Compression quality (1..1000) |
Compatibility note: This command calls for obsolete mechanisms and is only kept for compatibility reasons. It has been favorably replaced by the WRITE PICTURE FILE or PICTURE TO BLOB commands.
Description
This command compresses a picture document on disk. Use this command to compress a picture that you know cannot be loaded with the available memory. Once compressed, it can be loaded into memory using LOAD COMPRESS PICTURE FROM FILE.
Note: This command does not work on Windows.
The parameter method is a 4-character string indicating the compressor type. You should pass one of the constants of the Picture compression theme in method.
The parameter quality is an integer between 1 and 1000 indicating the quality of the compressed picture. In general, reducing the quality will allow for greater compression of the picture.
Warning: The compression ratio possible for a given quality depends on the size and nature of the picture you are compressing. Compressing small pictures may not produce any decrease in size.
Example
The following example presents the Open File dialog box that allows you to select a PICT file. Only PICT files will be displayed. The picture is compressed, loaded into memory, and stored in a picture variable. The file is then closed.
vRef:=Open document ("";"PICT") If (OK=1) COMPRESS PICTURE FILE(vRef;QT Photo compressor;500) LOAD COMPRESS PICTURE FROM FILE(vRef;"";500;vPict) CLOSE DOCUMENT(vRef) End if
See Also
COMPRESS PICTURE, LOAD COMPRESS PICTURE FROM FILE, SAVE PICTURE TO FILE.