QPxObs_GetImporterImageThumb

QPxObs_GetImporterImageThumb(importerRef; thumbPict; thumbWidth; thumbHeight; pixelDepth; fillColor; srcLeft; srcTop; srcRight; srcBottom):error
importerRef Longint Reference to a graphics importer instance
thumbPict Picture The thumbnail picture
thumbWidth Longint The thumbnail's width
thumbHeight Longint The thumbnail's height
pixelDepth Longint The thumbnail's pixel depth
fillColor Longint The thumbnail's fill color
srcLeft Longint Source rectangle left
srcTop Longint Source rectangle top
srcRight Longint Source rectangle right
srcBottom Longint Source rectangle bottom
error Longint Error result

Do not use this command in QPix v3 or later

This command is preserved in QPix v3 for backward compatibility reasons. In v3 it is substituted by QPx_CreateImporterThumbnail which creates high-quality thumbnails.


Creates a thumbnail from the image data associated with a graphic importer instance and returns the thumbnail properties.

The graphics importer instance is specified by importerRef. If importerRef does not refer to an existing graphics importer instance, qpx_paramErr is returned.

The thumbnail is returned in thumbPict. Thumbnail dimensions are specified by thumbWidth and thumbHeight. These need not be proportional to the original image dimensions; QPix will automatically scale down the image proportionally and center it inside the designated thumbnail bounds. This command will not scale up the image.

Thumbnail pixel depth is specified in the pixelDepth parameter. The pixelDepth parameter must be in range of 0..40 (values greater than 32 mean grayscale). If omitted or equal to 0, QPix will use the original pixel depth instead.

The source image rectangle can be specified in the srcLeft, srcTop, srcRight and srcBottom parameters. If omitted or if 0 is passed in all coordinates, the entire image area will be used for the thumbnail.

The color used to fill the areas of the thumbnail that will remain uncovered, is specified in the fillColor parameter. If omitted or equal to 0, QPix will use the black color. Fill color should be specified in the same way as in 4D's SET RGB COLOR command: 0x00RRGGBB.

Alternatively to RGB you can use 4D's automatic colors. You can also get a "tight" thubnail as explained below. See thumb options for the full list of all available constants and corresponding values.

"Tight" thumbnails

If you specify the value -256 (or the constant qpx_NoFill) in the fillColor parameter, QPix will function somewhat differently: instead of producing a thumbnail that fits exactly the designated size and fill the uncovered area with the designated fill color, it will produce a thumbnail that will contain only the useful part of the image. This is what we call a "tight" thumbnail.

Tight thumbnails normally occupy less bytes than color-filled ones. Also, their actual width and height is not identical to the width and height of the requested container rectangle. To get the actual dimensions of a tight thumbnail, use QPx_GetPictureInfo.

Example

  `Create a 80x80, 256 color thumbnail
  `Fill uncovered area with white color
 
C_LONGINT($error)
C_PICTURE($pict)
 
C_LONGINT(gQPixImporter)
 
$error:=QPx_GetImporterImageThumbnail (gQPixImporter;$pict; 80; 80; 8;0x00FFFFFF)
 
If ($error#qpx_noErr)
   `Handle the error
End if

QPix © Escape
Generated by QDoc 2.8 on Wed, Feb 17, 2010 17:47:11