L_WriteFileComment
#include "l_bitmap.h"
L_INT EXT_FUNCTION L_WriteFileComment(pszFile, pSaveOptions)
/* filename */ | |
pSAVEFILEOPTION pSaveOptions; |
/* pointer to optional extended save options */ |
Writes comments to an existing file.
Parameter |
Description |
PszFile |
Character string that contains the filename. |
pSaveOptions |
Pointer to optional extended save options. Pass NULL to use the default save options. pSaveOptions.PageNumber indicates the page on which to write the comments. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function only applies to TIF, uncompressed EXIF, or FPX files.
This function can be used to write TIFF comments without saving an image. It will also write all the comments set using the L_SetComment function. These are the same comments that will be written the next time a TIFF page is saved. For more information on saving files, refer to L_SaveFile. For more information on setting comments, refer to L_SetComment.
Comments to be written to a file may be passed directly to L_WriteFileCommentExt.
When you add or remove comments or tags, the comments and tags array at the end of the image file is re-written. When you modify existing comments or tags, the new value is added to the file and the IFD is modified as necessary. In all of these cases, there is no image recompression.
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, Windows CE.
See Also
Functions: |
L_SetComment, L_GetComment, L_WriteFileCommentExt, SAVEFILEOPTION, L_WriteFileMetaData |
Topics: |
|
|
Example
void TestSaveComment()
{
SAVEFILEOPTION SaveFileOption;
/* Set the tag data to be saved */
L_SetComment(CMNT_SZARTIST, "Me", 3);
L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));
SaveFileOption.PageNumber = 1;
/* Save the new comment to the file . */
L_WriteFileComment(TEXT("TEST.TIF"), &SaveFileOption);
/* Now select the file in the main demo and click on FileInfo.
"Me" should appear in the artist field */
}