version 3
LOAD COMPRESS PICTURE FROM FILE (document; method; quality; picture)
Parameter | Type | Description | |
document | DocRef | Document reference number | |
method | String | 4-character string compression method | |
quality | Number | Compression quality (1..1000) | |
picture | Picture | Compressed picture |
Description
This command compresses a picture loaded from a document on disk.
Note: This command does not work on Windows.
You can open a PICT document using the Open document function. You can then use the document reference returned by this function to load and compress the PICT found in the document. This command loads the picture into memory, compresses it using the method and quality you have specified, and then returns it into picture.
The picture is loaded into memory before it is compressed. If there is not enough memory to load the picture, use COMPRESS PICTURE FILE before calling LOAD COMPRESS PICTURE FROM FILE.
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. If method is an empty string, the picture is loaded but not compressed.
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 an Open File dialog box that allows you to select a PICT file. The picture in the PICT file is loaded into memory, compressed, and stored in a picture variable. The file is then closed.
vRef:=Open document ("";"PICT") If (OK=1) LOAD COMPRESS PICTURE FROM FILE(vRef;QT Photo compressor;500;vPict) CLOSE DOCUMENT(vRef) End if
See Also
COMPRESS PICTURE, COMPRESS PICTURE FILE, Pictures, SAVE PICTURE TO FILE.