ImgFrame_CreateThumb¶
imgDocRef | Text | The image document reference. |
frameIdx | Longint | The index of the image frame. |
options | Object | 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. To convert the BLOB to a 4D picture,
call BLOB TO PICTURE, or call directly ImgFrame_CreateThumbPicture
which is a convenience wrapper for this method.
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. Passing 0
or omitting this
parameter is the same as passing 1.
The options
4D object may contain the following properties:
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. |
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 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
This method is a convenience wrapper for the ImgFrame_CreateThumb_JSN
plug-in method.