Loads annotations from a position within a file. This enables you to load an annotation file that is embedded in another file.
#include "ltwrappr.h"
virtual L_INT LAnnContainer::LoadOffset(fd, nOffset, nLength, pLoadFileOption)
The Windows file handle of the file to load.
The position, from the beginning of the file, of the first byte to load. (The byte count starts at zero.)
The number of bytes of annotation data to read from the file. If you saved the offset using LAnnContainer::SaveOffset, the variable pointed to by puSizeWritten in that function contains the length of data saved. If you do not know the length of the data, pass 0xFFFFFFFF for this parameter.
Pointer to the LOADFILEOPTION structure to be updated with the current extended values.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Win32, x64.
L_INT LAnnContainer_LoadOffsetExample(LAnnContainer& LeadAContainer)
{
L_HANDLE OffsetFile; // File handle
L_SIZE_T ulSizeWritten; // Variable to be updated with the size written
L_INT nRet;
DWORD wWrittenBytes;
// Create a file ;
OffsetFile = CreateFile(MAKE_IMAGE_PATH(TEXT("TOFFSET.ANN")), GENERIC_ALL, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
// Write header information -- 29 characters and a terminator
WriteFile(OffsetFile, "This is a 29-character string", 30,&wWrittenBytes,NULL);
// Save the file with an offset
ulSizeWritten = LeadAContainer.SaveOffset((L_HFILE)&OffsetFile, 30, ANNFMT_NATIVE, FALSE);
// Close the file
CloseHandle(OffsetFile);
/* Loading */
if(ulSizeWritten>0)
{
// Open the file and get the file handle
OffsetFile = CreateFile(MAKE_IMAGE_PATH(TEXT("TOFFSET.ANN")), GENERIC_ALL, 0, NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
// Load the file with a 30-byte offset
nRet = LeadAContainer.LoadOffset((L_HFILE)OffsetFile, 30, ulSizeWritten, NULL);
if(nRet != SUCCESS)
return nRet;
// Close the file
CloseHandle(OffsetFile);
}
return SUCCESS;
}
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