#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnFileInfo(pszFile, pAnnFileInfo, uStructSize)
Gets information about the specified annotation file and fills the specified ANNFILEINFO structure with the information.
Character string containing the name of the annotation input file.
Pointer to the ANNFILEINFO structure to be filled. For more information, refer to the ANNFILEINFO structure.
Size in bytes, of the structure pointed to by pAnnFileInfo
, for versioning. Use sizeof(ANNFILEINFO).
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function can be used to find information about a LEAD annotation file.
To use this function, do the following:
Declare a variable with the datatype of ANNFILEINFO.
Fill in the nSize and nOffset fields of the ANNFILEINFO variable. The field nSize should contain the size of the ANNFILEINFO structure in bytes. The nOffset field should contain the byte location of the first byte of the annotation file.
Declare and assign a character string variable for the annotation file name.
Call the L_AnnFileInfo function, passing the file name and the address of the ANNFILEINFO variable as parameters.
Get the image information from the fields described in the ANNFILEINFO structure.
Required DLLs and Libraries
Win32, x64.
This example saves the annotation container as the first page of a multi-page annotation file.
The format is specified by the 'uFormat' parameter.
The container is flipped, and saved as the second page.
The container is rotated, and saved as the third page.
Information is displayed about the annotation file.
The second page is deleted, and information is again displayed about the annotation file.
L_INT AnnFileInfoExample(L_TCHAR* pszFileName,
L_INT32 uFormat,
HANNOBJECT hContainer)
{
L_INT nRet;
SAVEFILEOPTION SaveFileOption;
ANNFILEINFO AnnFileInfo;
L_TCHAR szMsg[200];
L_TCHAR* pszFormat;
//Save as the first page of the annotation file in memory
nRet = L_AnnSave(pszFileName, hContainer, uFormat, FALSE, NULL);
if (nRet != SUCCESS)
return nRet;
//Flip the container, and save as the second page (insert before page 2)
SaveFileOption.uStructSize = sizeof(SAVEFILEOPTION);
SaveFileOption.Flags = ESO_INSERTPAGE;
SaveFileOption.PageNumber = 2;
nRet = L_AnnFlip(hContainer, NULL, ANNFLAG_RECURSE);
if (nRet != SUCCESS)
return nRet;
nRet = L_AnnSave(pszFileName, hContainer, uFormat, FALSE, &SaveFileOption);
if (nRet != SUCCESS)
return nRet;
//Rotate the container, and save as the third page
nRet = L_AnnRotate(hContainer, 45.0, NULL, ANNFLAG_RECURSE);
if (nRet != SUCCESS)
return nRet;
SaveFileOption.PageNumber = 3;
nRet = L_AnnSave(pszFileName, hContainer, uFormat, FALSE, &SaveFileOption);
if (nRet != SUCCESS)
return nRet;
//Verify contents of file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = 0;
AnnFileInfo.nReserved = 0;
nRet = L_AnnFileInfo(pszFileName, &AnnFileInfo, sizeof(ANNFILEINFO));
if (nRet != SUCCESS)
return nRet;
switch(AnnFileInfo.uFormat)
{
case ANNFMT_NATIVE:
pszFormat = TEXT("ANNFMT_NATIVE");
break;
case ANNFMT_WMF:
pszFormat = TEXT("ANNFMT_WMF");
break;
case ANNFMT_ENCODED:
pszFormat = TEXT("ANNFMT_ENCODED");
break;
case ANNFMT_XML:
pszFormat = TEXT("ANNFMT_XML");
break;
default:
pszFormat = TEXT("Unknown");
break;
}
wsprintf(szMsg,
TEXT("File[%s]\nVersion[%d]\nFormat[%s]\nTotal Pages[%d]\n"),
pszFileName,
AnnFileInfo.nVersion,
pszFormat,
AnnFileInfo.nTotalPages);
MessageBox(NULL, szMsg, TEXT("Information"), MB_OK);
//Now delete the second page, and display information
nRet = L_AnnDeletePage(pszFileName, 2);
if (nRet != SUCCESS)
return nRet;
//Verify contents of file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = 0;
AnnFileInfo.nReserved = 0;
nRet = L_AnnFileInfo(pszFileName, &AnnFileInfo, sizeof(ANNFILEINFO));
if (nRet != SUCCESS)
return nRet;
wsprintf(szMsg,
TEXT("File[%s]\nVersion[%d]\nFormat[%s]\nTotal Pages[%d]\n"),
pszFileName,
AnnFileInfo.nVersion,
pszFormat,
AnnFileInfo.nTotalPages);
MessageBox(NULL, szMsg, TEXT("Information"), MB_OK);
return nRet;
}
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