L_AnnLoadOffset

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnLoadOffset(fd, nOffset, phObject, pLoadOptions)

L_INT fd;

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

L_INT32 nOffset;

/* position of the first byte to load */

L_UINT32 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 95 / 98 / Me, Windows 2000 / XP.

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

 

New Annotation Features of Version 14.5

Example

/* This example loads an annotation file with a 30-byte offset. */
/* Refer to L_AnnSaveOffset to see how the test file is created. */
HANNOBJECT hContainer; /* Container annotation object */
void TestAnnLoadOffset(HWND hWnd)
{
   HANNOBJECT TmpContainer;
   HFILE OffsetFile; /* File handle */
   int nRet;
   HDC hdc;
   RECT rAnnBounds;
   RECT rAnnBoundsName;

   /* Open the file and get the file handle */
   #ifdef UNICODE

OffsetFile = _wopen(TEXT("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TOFFSET.ANN"), OF_READ|OF_SHARE_DENY_WRITE );

#else

OffsetFile = _lopen("E:\\LEAD Technologies, Inc\\LEADTOOLS\\images\\TOFFSET.ANN", OF_READ|OF_SHARE_DENY_WRITE );

#endif

   /* Load the file with a 30-byte offset */
   nRet = L_AnnLoadOffset(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);
   }
   /* Close the file */
   _lclose(OffsetFile);
   return;
}