Saving the annotation in a TIFF file

The annotation can also be saved in the TIFF file header as a standard TIFF data tag. There are functions in the BiTiff.dll to add annotations to the TIFF file.

 

If you want to simply save all annotations to the TIFF use the SaveAnnotationIntoTiff function. You should specify filename, annotation handle and the tag number for this function. This function overwrite annotation objects in the TIFF file.

 

The SaveAnnotationIntoTiffExt function gives more possibilities. You can overwrite or append annotation objects in the TIFF file.

For example there are a DIB and annotations to save to a TIFF file. If the file already exists you can append the annotations to the file:

 

// Save the DIB If szTiffFileName is exists, the DIB will be appended to the image.

BOOL bSuccess = SaveDIBInTiff(szTiffFileName, hDib, CompMode, nPhotomInterp, BitOrder, &sNote, AfxGetInstanceHandle() );

if (bSuccess)

{

            // Append annotation to the file

            int iPages = GetNumberOfImagesInTiffFile( szTiffFileName );

SaveAnnotationIntoTiffExt(szTiffFileName, wTag, SAVE_ANNO_APPEND, nCurrent, iPages - 1 );

}

 

The function collects annotation objects that are on the nCurrent page, and appends to the TIFF file. The iPages - 1 means that the objects will be displayed on the last page when the TIFF is loaded.

For details, please see the related section of this manual.