Specifies a field to be saved as a comment in a file.
#include "ltwrappr.h"
static L_INT LFileSettings::SetComment(uType, pComment, uLength)
The type of comment. Valid values are:
Value | Meaning |
---|---|
JPEG and LEAD FileComments | |
Tiff FileComments | |
Exif FileComments | |
Gif FileComments | |
Dicom FileComments | |
FlashPix FileComments | |
CMNT_LAST | Last defined number for comments. To clear all fields, you can use the type constant as a loop counter. The first constant is 0 and the last is CMNT_LAST. |
Pointer to the buffer containing the comment field that you want to set. You can pass NULL to clear the current field.
The size of your buffer that contains the comment field. (If the buffer is actually a single string, this is the string length + 1.)
Value | Meaning |
---|---|
>=0 | Length of the comment field. |
< 0 | An error occurred. Refer to Return Codes. |
Some file formats can contain comments, and some cannot, and each file format has its own set of comment types. When you save a file, the comments, which LEADTOOLS maintains in a global array, are saved in the file. The index into the array (specified using a constant) determines the type of comment, as described in Types of File Comments.
Note: When LEADTOOLS saves a TIFF/Exif image that contains comments and tags, the comments and tags will be written first, followed by the image data. This order is not configurable.
This function works with related functions. For example, consider the following possible sequence:
Use the LFileSettings::SetComment function to specify any of the comments that you want to save in a file header.
Use the LFileSettings::GetComment function to let the user review the comments before they are saved.
Save one or more files that you want to include the currently specified comments. You can use any LEADTOOLS function that saves a file. The file format can be any that includes a TIFF header, such as CCITT or TIFF (but not JTIF).
Use the LFileSettings::SetComment function with a NULL buffer and 0 length to clear each of the comment fields. You must call the this function once for each specified field. To clear all fields, you can use the type constant as a loop counter. The first constant (specified in the uType parameter) is 0 and the last is CMNT_LAST.
Use the LFile::ReadComment function to let the user review the comments that have been saved in a file.
Note: More options are available in the SAVEFILEOPTION structure.
Win32, x64.
For an example, refer to LFile::ReadComment.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document