L_AddMessageToBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AddMessageToBitmap(pBitmap, pAddMesgInfo)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

LPADDMESGINFO pAddMesgInfo;

/* pointer to a structure */

Adds a message (text or file) to the specified bitmap. The message is specified by the pAddMesgInfo parameter. This function is available in the Document/Medical Toolkits.

Parameter

Description

pBitmap

Pointer to the bitmap handle referencing the destination bitmap. This is the bitmap that the function updates.

pAddMesgInfo

Pointer to an ADDMESGINFO structure that contains information about the message that will be added.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The purpose of this function is for security since the message added will be embedded into the image without any visible changes and the resulting image has the same size as the original.

This function can add message to any type of losslese image such as bmp, tiff, lossless jpeg, and so forth. If used with lossy format types the message may be corrupted or lost.

This function supports 24- and 48-bits images, and 8- and 16-bits grayscale images.

To extract the embedded message use the L_ExtractMessageFromBitmap function.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

This function supports signed data images.

Required DLLs and Libraries

LTIMG

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

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_ExtractMessageFromBitmap

Topics:

Raster Image Functions: Getting and Setting File Information

 

Non-Image Data

Example

/* This example loads a bitmap and adds a text message to it. */
BITMAPHANDLE pBitmap;
LPADDMESGINFO pAddMesgInfo;

pAddMesgInfo = (LPADDMESGINFO) GlobalAllocPtr(GHND, sizeof(ADDMESGINFO));
if(!pAddMesgInfo)
   return;

pAddMesgInfo->uStructSize =  sizeof(ADDMESGINFO);
pAddMesgInfo->pStrMsg = (L_TCHAR *) GlobalAllocPtr(GHND, 200);
if(!pAddMesgInfo->pStrMsg)
   return;

/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap
 (TEXT("IMAGE1.CMP"), &pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);

lstrcpy(pAddMesgInfo->pStrMsg, TEXT("LEAD Technologies, Inc."));

/*Add the above message to image in the default position and with the default password */
L_AddMessageToBitmap
(&pBitmap, pAddMesgInfo);

/*Free the temporary buffers. */
if(pAddMesgInfo->pStrMsg)
   GlobalFreePtr(pAddMesgInfo->pStrMsg);

if(pAddMesgInfo)
   GlobalFreePtr(pAddMesgInfo);