L_SetOverlayCallback

#include "l_bitmap.h"

L_LTFIL_API L_INT L_SetOverlayCallback(pfnCallback, pUserData, uFlags)

Specifies how to load the overlay bitmap and optionally sets a callback function.

Parameters

OVERLAYCALLBACK pfnCallback

Your callback function that asks the user for the overlay bitmap, when loading a file containing an overlay. The callback function must adhere to the syntax specified in OVERLAYCALLBACK. Pass NULL If there is no overlay callback function. If a callback function is set, the callback function will be used only if OVERLAY_LOADONLY is not set in uFlags.

L_VOID* pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.

If the additional parameters are not needed, you can pass NULL in this parameter.

L_UINT uFlags

Flags that indicate the method(s) to use when loading an overlay bitmap and the order in which to perform those methods. Possible values are:

Value Meaning
OVERLAY_LOADCALL [0x0001] First, try loading the overlay bitmap from disk. If the load fails, the overlay callback will be asked to provide the overlay bitmap.
OVERLAY_CALLLOAD [0x0002] First, call the overlay callback. If the callback did not supply an overlay bitmap, try loading the overlay bitmap from disk.
OVERLAY_CALLONLY [0x003] Call the overlay callback. If there is no callback function set, there is no overlay bitmap.
OVERLAY_LOADONLY [0x0004] Try to load the overlay bitmap from disk. If the load fails, there is no overlay.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The overlay callback set using L_SetOverlayCallback becomes the current callback. To get the current overlay callback, call L_GetOverlayCallback.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

For an example, refer to the OVERLAYCALLBACK function.

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

LEADTOOLS Raster Imaging C API Help