L_AnnLoadOffset

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnLoadOffset(fd, nOffset, nLength, phObject, pLoadOptions)

L_HFILE fd;

/* Windows file handle of the file to load */

L_SSIZE_T nOffset;

/* position of the first byte to load */

L_SIZE_T nLength;

/* number of bytes to read */

pHANNOBJECT phObject;

/* address of the variable to be updated */

pLOADFILEOPTION pLoadOptions;

/* pointer to optional extended load options */

Loads annotations from a position within a file. This enables you to load an annotation file that is embedded in another file. This function is available in the Document/Medical Toolkits.

Parameter

Description

fd

The Windows file handle of the file to load.

nOffset

The position, from the beginning of the file, of the first byte to load. (The byte count starts at zero.)

nLength

The number of bytes of annotation data to read from the file. If you saved the offset using L_AnnSaveOffset, 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.

phObject

Address of the variable to be updated with the handle to the container object of the loaded annotations.

pLoadOptions

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

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phObject parameter. This function will update the variable with the handle to the container object of the loaded annotations.

For more information about loading and pasting automated annotations, refer to Loading and Pasting Automated Annotations.

Required DLLs and Libraries

LTANN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 2000 / XP/Vista.

See Also

Functions:

L_AnnDeletePage, L_AnnDeletePageMemory, L_AnnDeletePageOffset, L_AnnFileInfo, L_AnnFileInfoMemory, L_AnnFileInfoOffset, L_AnnLoad, L_AnnLoadMemory, L_AnnSave, L_AnnSaveMemory, L_AnnSaveOffset, L_AnnSetOptions, L_AnnGetOptions

Topics:

Annotation Files

 

Annotation Functions: Input and Output

 

Implementing Annotations

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Annotation Features

Example

This example loads an annotation file with a 30-byte offset. Refer to L_AnnSaveOffset to see how the test file is created.

#include <Tchar.h>
 L_INT AnnLoadOffsetExample(HWND       hWnd,
                                          HANNOBJECT hContainer)/* Container annotation object */
{
   HANNOBJECT  TmpContainer;
   HANDLE      OffsetFile = NULL; /* File handle */
   L_INT       nRet;
   HDC         hdc;
   RECT        rAnnBounds;
   RECT        rAnnBoundsName;

   /* Open the file and get the file handle */
   OffsetFile = CreateFile(TEXT("C:\\Program Files\\LEAD Technologies\\LEADTOOLS 15\\Images\\TEST.ANN"), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

   /* Load the file with a 30-byte offset */
   nRet = L_AnnLoadOffset((L_HFILE) OffsetFile, 30, 0xFFFF, &TmpContainer, NULL);
   /* if successfully loaded, view them */
   if (nRet == SUCCESS)
   {
      L_AnnInsert(hContainer, TmpContainer, TRUE);
      hdc = GetDC(hWnd);
      L_AnnGetBoundingRect(hContainer, &rAnnBounds, &rAnnBoundsName);
      L_AnnDraw(hdc, &rAnnBounds, hContainer);
   }
   else
      return nRet;
   /* Close the file */
   CloseHandle(OffsetFile);
   return SUCCESS;
}