4D v13.4

QT LOAD COMPRESS PICTURE FROM FILE

Home

 
4D v13.4
QT LOAD COMPRESS PICTURE FROM FILE

QT LOAD COMPRESS PICTURE FROM FILE 


 

QT LOAD COMPRESS PICTURE FROM FILE ( document ; method ; quality ; picture ) 
Parameter Type   Description
document  DocRef in Document reference number
method  String in 4-character string compression method
quality  Longint in Compression quality (1..1000)
picture  Picture in Compressed picture

This command calls for obsolete mechanisms and is only kept for compatibility reasons. It has been favorably replaced by the READ PICTURE FILE and CONVERT PICTURE commands.

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 QT COMPRESS PICTURE FILE before calling QT 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

 
PROPERTIES 

Product: 4D
Theme: Pictures
Number: 357

This command is deprecated and should not be used anymoreWindows specific

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: < 4D v6
Renamed: 4D v12

 
SEE ALSO 

CONVERT PICTURE
Pictures
QT COMPRESS PICTURE
QT COMPRESS PICTURE FILE
READ PICTURE FILE
SAVE PICTURE TO FILE