QMed_GetImageThumbnail(imageRef; thumbPict; thumbWidth; thumbHeight; codecType; codecQuality; codecDepth):error
imageRef Longint Reference to the image
thumbPict Picture The thumbnail picture
thumbWidth Longint Thumbnail width
thumbHeight Longint Thumbnail height
codecType String4 Codec type (optional)
codecQuality Longint Compression quality (optional)
codecDepth Longint Compression depth (optional)
error Longint Error result

Creates, and optionally compresses, a picture thumbnail from an image.

The image is specified by imageRef. If imageRef is not a valid image, error qmed_paramErr is returned.

The thumbnail is returned in parameter thumbPict.

Parameters thumbWidth and thumbHeight specify the desired width and height of the thumbnail. These need not be proportional to the original image dimensions; QMedical will scale down the image proportionally to fit inside the designated thumbnail bounds. The actual dimensions of the thumbnail will be less than or equal to the specified parameters. This command will not scale up the image.

Parameter codecType is optional. If specified, it must contain a 4-character code that identifies a QuickTime compressor component (codec). QMedical will call that codec to compress the thumbnail picture. To get a list of all available codecs, call the QMed_GetCodecList command.

The codecQuality parameter specifies the quality of the compressed thumbnail. Valid values are in the range of 0 - 1024. QMedical defines the following constants for the codecQuality parameter:

qmed_MinQuality 0 Minimal quality
qmed_LowQuality 256 Low quality
qmed_NormalQuality 512 Normal quality
qmed_HighQuality 768 High quality
qmed_MaxQuality 1023 Maximum quality
qmed_LosslessQuality 1024 Lossless quality

The codecDepth parameter specifies color depth for the compressed thumbnail. If omitted or set to 0, QMedical uses the original image depth. Possible values for codecDepth are:

Black and white images 1

Color images 2, 8, 16, 24, 32

Grayscale images 34 (2 bit), 36 (4-bit), 40 (8-bit)


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.


  `Create a 80x80 thumbnail
  `Compress with jpeg, normal quality at 8-bit grayscale
$error:=QMed_GetImageThumbnail (gImageRef;$pict;80;80;'jpeg';qmed_NormalQuality;40)
If ($error # qmed_noErr)
   `Handle the error
End if

QMedical © Escape
Generated by QDoc 2.8 on Wed, Jan 27, 2010 17:54:33