ImgFrame_CreateThumb_JSN

Create a thumbnail from an image frame.
ImgFrame_CreateThumb_JSN(imgDocRef;frameIdx;optionsJSON) ➔ thumb
imgDocRef Text The image document reference.
frameIdx Longint The image frame index.
optionsJSON Text Thumbnail creation and encoding options.
↩︎ thumb BLOB The thumbnail data.

Create a thumbnail from an image frame. The thumbnail image is returned as a BLOB.

If the method call fails for some reason, an empty BLOB is returned and the Q2Pix error info is set accordingly.

Parameter imgDocRef is the image document reference. This method works with both raster images and PDF documents.

Parameter frameIdx is the index of the image frame.

The optionsJSON parameter is a 4D object serialized in JSON format:

Thumbnail Creation Options
Property name Type Default Description
ApplyOrientation Boolean True The option’s value specifies whether or not the returned thumbnail should have its orientation fixed.
MaxPixelSize SizeObj object {"Width": 160, "Height": 160} The option’s value specifies the maximum width and height of the thumbnail in pixels.
Oriented Boolean True The option’s value specifies whether the maximum thumbnail size set with the MaxPixelSize property is expressed in the oriented or to the raw image coordinate space.
Thumbnail Encoding Options
Property name Type Default Description
Format String TIFF The option’s value specifies the image format of the thumbnail. The thumbnail format can be be one of JPEG, TIFF, or PNG.
LossyCompressionQuality Real 0.75

Effective when the thumbnail is encoded in JPEG format, this option’s value is a real number in the range of 0.0 to 1.0, specifying the image quality.

The higher this number is, the higher the quality of the encoded thumbnail will be at the expense of larger size in bytes. Lower numbers produce smaller encoded thumbnails in bytes, at the expense of lower image quality.

TIFFMonochromeEncoding Longint kTIFFCompressionCCITTFax4

Effective when the thumbnail is encoded in TIFF format, this option’s value is a number specifying the TIFF encoding method for black and white images.

Can be one of: kTIFFCompressionNone, kTIFFCompressionCCITTRLE, kTIFFCompressionCCITTFax3, kTIFFCompressionCCITTFax4.

TIFFGrayscaleEncoding Longint kTIFFCompressionLZW

Effective when the thumbnail is encoded in TIFF format, this option’s value is a number specifying the TIFF encoding method for grayscale images.

Can be one of: kTIFFCompressionNone, kTIFFCompressionLZW, kTIFFCompressionDeflate.

TIFFColorEncoding Longint kTIFFCompressionLZW

Effective when the thumbnail is encoded in TIFF format, this option’s value is a number specifying the TIFF encoding method for color images.

Can be one of: kTIFFCompressionNone, kTIFFCompressionLZW, kTIFFCompressionDeflate.

Note

The ImgFrame_CreateThumb and ImgFrame_CreateThumbPict methods the Q2PixLib component are convenience wrappers for this method that accept the options parameter directly as a 4D object instead of a JSON serialization.