THUMBOPTIONS

typedef struct _THUMBOPTIONS 
{ 
   L_UINT uStructSize; 
   L_INT nWidth; /* thumbnail width */ 
   L_INT nHeight; /* thumbnail height */ 
   L_INT nBits; /* thumbnail bits per pixel */ 
   L_UINT uCRFlags; /* color resolution flags */ 
   L_BOOL bMaintainAspect; /* aspect ratio flag */ 
   L_BOOL bForceSize; /* force size flag */ 
   L_COLORREF crBackColor; /* background color */ 
   L_BOOL bLoadStamp; /* load stamp flag */ 
   L_BOOL bResample; /* resample flag */ 
} THUMBOPTIONS, * pTHUMBOPTIONS; 

The THUMBOPTIONS structure is used by the LFile::CreateThumbnail and the LFile::CreateThumbnailCallBack functions to specify the thumbnail creation options.

Member

Description

uStructSize

Size of this structure in bytes. Use the sizeof() operator to calculate this value.

nWidth

Width of the thumbnail to create. This value is measured in pixels. The maximum value is 400. The minimum value is 16.

nHeight

Height of the thumbnail to create. This value is measured in pixels. The maximum value is 400. The minimum value is 16.

nBits

Resulting bitmap pixel depth. The following are valid values:

 

Value

Meaning

 

0

Default bits per pixel stored in the file

 

1 to 8

The specified bits per pixel in the resultant bitmap

 

12

12 bits per pixel in the resultant bitmap.

 

16

16 bits per pixel in the resultant bitmap

 

24

24 bits per pixel in the resultant bitmap

 

32

32 bits per pixel in the resultant bitmap

 

48

48 bits per pixel in the resultant bitmap

 

64

64 bits per pixel in the resultant bitmap

uCRFlags

Flags that will be passed to LBitmapBase::ColorRes internally when bForceSize is True, bMaintainAspect is True, and the source image is not 24-bit. In this case, the thumbnail image is converted to 24-bit, then, combined with a "background" bitmap. The resulting bitmap is then returned to the thumbnail image's original bit-depth using uCRFlags. For a list of possible values, refer to the uFlags parameter of LBitmapBase::ColorRes.

bMaintainAspect

Flag that indicates whether the aspect ratio of the image should be maintained when creating the thumbnail. When set to TRUE, the generated thumbnail's width and height will not match both nThumbWidth and nThumbHeight if the original aspect ratio was not 1:1. If you desire the thumbnail be generated with exactly the requested width and height while still maintaining the aspect ratio of the actual image, set both bMaintainAspect and bForceSize to TRUE.

bForceSize

Flag that indicates whether the generated thumbnail should be forced to the requested size, even if bMaintainAspect is set to TRUE. If bForceSize is TRUE, the thumbnail bitmap will be generated by creating a "canvas" bitmap with the requested size, and then centering the actual image inside that bitmap. Note this is a slower process. This parameter is ignored if bMaintainAspect is FALSE.

crBackColor

Background color to use if both bForceSize and bMaintainAspect are TRUE.

bLoadStamp

Flag that indicates whether or not to attempt to load stamps from file formats that support preview images. Possible values are:

 

Value

Meaning

 

TRUE

Attempt to load stamps.

 

FALSE

Do not attempt to load stamps.

bResample

Flag that indicates whether or not to use interpolated resize when generating thumbnails. Possible values are:

 

Value

Meaning

 

TRUE

Use interpolated resize.

 

FALSE

Do not use interpolated resize.

Comments

If the bLoadStamp member of this structure is set to TRUE when LFile::CreateThumbnail is called and the file does not contain a stamp, then an error will be returned.

If 0 is specified for either nHeight or nWidth, the image will not be resized. The whole image will be returned in the LFile::BrowseDirCallBack function.

If -1 is specified for either the nHeight or nWidth, the image will not be loaded at all. The LFile::BrowseDirCallBack function will be called for each file, but will only receive file information, not a valid image.

Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() operator to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.

Help Version 20.0.2020.4.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help