L_WriteFileStamp

Summary

Writes a stamp in an existing JPEG or FlashPix file.

Syntax

#include "l_bitmap.h"

L_LTFIL_API L_INT L_WriteFileStamp(pszFile, pBitmap, pSaveOptions)

Parameters

L_TCHAR* pszFile

Character string containing the file name.

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle referencing the bitmap that will contain the thumbnail image.

pSAVEFILEOPTION pSaveOptions

Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The stamp will be written to the page designated in the SAVEFILEOPTION structure. If that page already has a stamp, it will be overwritten; if the page does not exist, the stamp will be written to the last page present in the file. If the file to which the stamp is being written does not exist, an error will be returned.

This function works for JPEG, Exif, PNG, and TIF. For regular JPEG files, the stamp saved is always uncompressed and can be 8 or 24 bits per pixel. For JPEG files, the stamp width and height must be <= 255, and the stamp data and stamp header must completely fit in an APP0 marker. Therefore, the size must be less than 64k bytes (0xFFFF).

For Exif JPEG files, the stamps can be uncompressed or JPEG compressed and must be 24 bits per pixel. Exif JPEG stamps are supposed to be 160 x 120. However, LEADTOOLS can save and read Exif JPEG stamps of other dimensions. The stamp, along with other information such as the TIFF_HEADER, 0th IFD, 1st IFD, etc. must completely fit in an APP1 marker. Therefore, the size must be less than 64k bytes (0xFFFF).

For PNG files, the stamp will be saved uncompressed. The width and height are not limited but bitmap should 24-bit.

Note

At this time, there are no multipage formats that support stamps that can be updated using this function.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

Puts a stamp, in an existing FlashPix file.

L_INT WriteFileStampExample(pBITMAPHANDLE pStampBitmap) 
{ 
   L_INT nRet; 
   nRet = L_WriteFileStamp(MAKE_IMAGE_PATH("IMAGE1.FPX"), pStampBitmap, NULL); 
   return nRet; 
} 

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.