BROWSEDIRCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(pBitmap, pszFilename, pInfo, nStatusCode, nPercent, pUserData)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

L_TCHAR L_FAR * pszFilename;

/* pointer to the filename */

pFILEINFO pInfo;

/* pointer to the file info structure */

L_INT nStatusCode;

/* status code */

L_INT nPercent;

/* percentage completion of a file load */

L_VOID L_FAR* pUserData;

/* pointer to additional parameters */

Handles the thumbnails generated by calling the L_BrowseDir function.

Parameter

Description

pBitmap

The pointer to the bitmap handle referencing the thumbnail generated by L_BrowseDir. You can copy this bitmap, save it to file, insert it into a LEADTOOLS ImageList Control, or otherwise process it as needed in your application.

pszFilename

Character string containing the filename from which this thumbnail was generated.

pInfo

Pointer to a FILEINFO structure containing information about pszFilename.

nStatusCode

Status code. If an error occurred during thumbnail generation, this will be < SUCCESS. Possible values are:

 

Value

Meaning

 

<SUCCESS

An error occurred.

 

SUCCESS

[1] Image was loaded.

 

BROWSE_LOADING

[2] Indicates image is being loaded, see nPercent.

 

BROWSE_SKIPPED

[3] Indicates image was skipped because it was larger than the specified range in L_BrowseDir.

 

BROWSE_PRELOAD

[4] Indicates that LEADTOOLS has found a file and is about to determine the file format. It will then attempt to create a thumbnail for it. If the user wishes to avoid the internal file information processing, return ERROR_FILE_FORMAT. This will cause LEADTOOLS to skip the file.

nPercent

Represents the percentage completion of a file load when nStatusCode is equal to BROWSE_LOADING.

pUserData

A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.). Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS

The function was successful.

< SUCCESS

An error occurred. Return Codes

Comments

You must return SUCCESS to continue browsing for supported image files. The value you return from this callback will also be returned from L_BrowseDir.

Required DLLs and Libraries

LTFIL
LTIMG
LTTMB
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_BrowseDir, L_LoadBitmap, L_GetCompressFileStamp, L_SetExtFileOption, L_SetLoadResolution, L_SetPCDResolution, L_SetWMFResolution

Topics:

Thumbnail Browser

Example

For an example, refer to L_BrowseDir.