L_SetMarkers

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetMarkers(hMarkers, uFlags)

HANDLE hMarkers;

/* marker handle */

L_UINT uFlags;

/* flags that determine function behavior */

Sets the metadata markers to be used in the current thread.

Parameter

Description

hMarkers

Handle to a collection of metadata markers. This handle is created by either the L_LoadMarkers function or the L_CreateMarkers function. This handle can reference Exif and/or GPS comments, a small Exif stamp, a bigger wireless stamp, audio data and whatever else was in the original file.

 

The markers referenced by this handle will replace the markers previously set using L_SetMarkers.

 

Pass NULL to clear any markers previously set by L_SetMarkers.

uFlags

Reserved for future use. Pass 0.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

All save operations performed in this thread will use these markers until L_SetMarkers is called again.

A copy of these markers will be used, so you can delete hMarkers when L_SetMarkers returns.

Comments set with L_SetComment will take precedence over any comments contained in the markers.

Tags set with L_SetTag will take precedence over any user-defined tags contained in the markers.

If the L_SaveXXX function is instructed to save a stamp, the stamp will be regenerated from the bitmap and will override whatever Exif stamp is present in the markers.

Required DLLs and Libraries

LTFIL

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_CreateMarkers, L_LoadMarkers, L_SaveBitmap, L_SaveBitmapBuffer, L_SaveBitmapList, L_SaveBitmapMemory, L_SaveBitmapWithLayers, L_SaveFile, L_SaveFileBuffer, L_SaveFileMemory, L_SaveFileOffset, L_SaveFileTile

Topics:

Raster Image Functions: Markers

 

Working with Markers

Example

This example lets you modify a file and preserve all its metadata, comments and audio. Keep in mind this will not save any stamp. If you want to save a stamp, modify the L_SaveBitmap call and tell it to save a stamp. That will make L_SaveBitmap regenerate a new stamp so it matches the modified image.

L_VOID SetMarkers( L_TCHAR L_FAR* pszFile )

{

HANDLE hMetadata;

BITMAPHANDLE Bitmap;

// load metadata info
L_LoadMarkers
(pszFile, &hMetadata, 0);

// load the bitmap

L_LoadBitmap
(pszFile&Bitmap, sizeof(BITMAPHANDLE), 0, ORDER_RGB, NULL, NULL);

// modify the bitmap. In this case, flip it

L_FlipBitmap
(&Bitmap);

// set the metadata markers so they are used in the next save

L_SetMarkers
(hMetadata, 0);

// save the file 

L_SaveBitmap
(TEXT("FlippedFile.jpg"), &Bitmap, FILE_EXIF_JPEG, 0, 50, NULL);

// reset the markers so they are not used for the next save

L_SetMarkers
(NULL, 0);

// free memory containing the metadata

L_FreeMarkers
(hMetadata);

}