QPix Command Reference Compression |

### QPx_CompressPictureFile

QPx_CompressPictureFile(filePath; codecType; compQuality; compDepth; compFlags):error
| filePath | Text | Full pathname
| codecType | String4 | Codec type
| compQuality | Longint | Compression quality
| compDepth | Longint | Compression depth, optional
| compFlags | Longint | Compression flags, optional
| error | Longint | Error result

Compresses the image contained in a PICT file.

The filePath parameter contains the full pathname to the PICT file. If it is empty, QPix presents the standard file selection dialog where the user can select a PICT file to compress. If the user does select a disk file, QPix returns in this parameter the file's full pathname. If the user cancels, qpx_userCancelErr (-128) is returned.

The codecType parameter specifies the codec (compressor component) that will do the compression. For a list of available codecs, use the QPx_GetCodecList command.

The compQuality parameter specifies the quality of the compressed picture. Valid values are in the range of 0 - 1024. High values mean high quality and result to larger compressed pictures, while low values mean low quality and usually result to smaller compressed pictures. QPix defines the following constants for the compQuality parameter:

qpx_MinQuality | 0 | Minimal quality
qpx_LowQuality | 256 | Low quality
qpx_NormalQuality | 512 | Normal quality
qpx_HighQuality | 768 | High quality
qpx_MaxQuality | 1023 | Maximum quality
qpx_LosslessQuality | 1024 | Lossless quality

The compDepth parameter specifies color depth for the compressed image. If omitted or set to 0, QuickTime determines the appropriate value for the picture (best depth). Possible values for compDepth are:

Black and white images | 1
Color images | 2, 8, 16, 24, 32
Grayscale images | 34 (2 bit), 36 (4-bit), 40 (8-bit)

The optional compFlags parameter specifies additional compression options. Currently, the only supported option is to display a progress dialog if the compression will take long to complete. To display the progress dialog, set the compFlags parameter to 1.

Note: Not all codecs support all quality and depth values. If a codec does not support the specified values for quality or depth, it will automatically fall back to its respective default values.

Related commands

QPx_DoCodecSettingsDialog | Displays the standard compression settings dialog
QPx_GetCodecList | Returns the list of available compressors/decompressors

QPix © Escape Information Services
Generated by QDoc 2.6 on Thu, 2 May 2002 00:49:53 +0300