BORDERREMOVECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction(hRgn, uBorderToRemove, pBoundingRect, pUserData)

HRGN hRgn;

/* windows region */

L_UINT uBorderToRemove;

/* border flag */

PRECT pBoundingRect;

/* pointer to a RECT structure */

L_VOID *pUserData;

/* pointer to additional parameters */

Handles each border found by L_BorderRemoveBitmap. This function is available in the Document/Medical Toolkits.

Parameter

Description

hRgn

Windows region representing the border to be removed. It is the programmers responsibility to delete this region (using DeleteObject() when it is no longer needed).

uBorderToRemove

Flag that indicates which border is being processed. Possible values are:

 

Value

Meaning

 

BORDER_LEFT

The left border is being processed.

 

BORDER_TOP

The top border is being processed.

 

BORDER_RIGHT

The right border is being processed.

 

BORDER_BOTTOM

The bottom border is being processed.

pBoundingRect

Pointer to a RECT structure that contains the bounding rectangle of the border being processed.

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 L_BorderRemoveBitmap.)

 

Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS_REMOVE

Remove the border.

SUCCESS_NOREMOVE

Do not remove the border.

Otherwise

An error occurred. Refer to Return Codes.

Comments

The callback is called once for each border found. It is called a maximum of four times for each call to the API. Return SUCCESS_REMOVE to have the border removed. Return SUCCESS_NOREMOVE to leave the border unchanged. Pass any other value to abort. This value will be the return value of the L_BorderRemoveBitmap(). If flags BORDER_IMAGE_UNCHANGED and BORDER_SINGLE_REGION are being used, then the return value of the callback affects only the internal single region that contains all the changes.

Required DLLs and Libraries

LTIMGCOR

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_BorderRemoveBitmap

Topics:

Cleaning Up 1-Bit Images

Example

For an example, refer to L_BorderRemoveBitmap.