THUMBOPTIONS
typedef struct thumboptions
{
L_UINT uStructSize;
L_INT nThumbWidth; /* thumbnail width */
L_INT nThumbHeight; /* thumbnail height */
L_INT nBits; /* thumbnail bits per pixel */
L_UINT32 uCRFlags; /* color resolution flags */
L_BOOL bMaintainAspect; /* aspect ratio flag */
L_BOOL bForceSize; /* force size flag */
COLORREF crBackColor; /* background color */
L_BOOL bLoadStamp; /* load stamp flag */
L_BOOL bResample; /* resample flag */
} THUMBOPTIONS, L_FAR * pTHUMBOPTIONS;
The THUMBOPTIONS structure is used by L_CreateThumbnailFromFile to specify the thumbnail creation options.
Member |
Description |
|
uStructSize |
Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value. |
|
nThumbWidth |
Width of the thumbnail to create. This value is measured in pixels. |
|
nThumbHeight |
Height of the thumbnail to create. This value is measured in pixels. |
|
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 L_ColorResBitmap 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 L_ColorResBitmap. |
|
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 L_CreateThumbnailFromFile is called and the file does not contain a stamp, then an error will be returned.
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() macro 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.