QPix Command Reference
![]() |
![]() ![]() |
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:
qpx_BlackAndWhite | 1 | Black and white |
qpx_FourColors | 2 | Four colors |
qpx_SixteenColors | 4 | Sixteen colors |
qpx_TwoHundredFiftySixColors | 8 | 256 colors |
qpx_ThousandsColors | 16 | Thousands of colors |
qpx_MillionColors | 24 | Million of colors |
qpx_MillionColorsPlusAlpha | 32 | Million of colors plus alpha |
qpx_FourGrays | 34 | Four grays |
qpx_SixteenGrays | 36 | Sixteen grays |
qpx_TwoHundredFiftySixGrays | 40 | 256 grays |
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 |