L_SetDJVOptions

#include "l_bitmap.h"

L_LTFIL_API L_INT L_SetDJVOptions (pOptions);

pFILEDJVOPTIONS pOptions;

/* pointer to a structure */

Sets the current options used by LEADTOOLS when loading DjVu files.

Parameter

Description

pOptions

Pointer to a structure that contains the current DjVu options to set. These options will be used when loading a DjVu file.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The uStructSize member of the FILEDJVOPTIONS structure must be set before calling this function. If a DjVu file is loaded without first calling this function, the following default value is used:

FILEDJVOPTIONS member

Default Value

nResolution

96

The values set by this function are valid for this thread. To change the values used by the current thread, call this function again, with the new values set in the FILEDJVOPTIONS structure pointed to by the pOptions parameter.

To get the current options used when loading a DjVu file, call L_GetDJVOptions.

Required DLLs and Libraries

LTFIL
File format DLLs

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_GetDJVOptions

Topics:

Loading and Saving Images

 

Raster Image Functions: Loading Files

Example

This example loads a DJV file, with a resolution defined by the user


 L_INT SetDJVOptionsExample(L_TCHAR     * pszDJVFileName,
                                           pBITMAPHANDLE pBitmap,
                                           L_INT         nDisplayDepth)
{
   L_INT nRet;
   FILEDJVOPTIONS DjvOptions;
   UNREFERENCED_PARAMETER(nDisplayDepth);

   /* Get the current DJV option */
   nRet = L_GetDJVOptions(&DjvOptions,sizeof(FILEDJVOPTIONS));
   if(nRet != SUCCESS)
      return nRet;

   /*Change Resolution */
   DjvOptions. nResolution = 120;

   /* Set new DJV option */
   nRet = L_SetDJVOptions(&DjvOptions);
   if(nRet != SUCCESS)
      return nRet;

   /* Now load the DJV file */
   if(pBitmap->Flags.Allocated)
      L_FreeBitmap(pBitmap);
   nRet = L_LoadBitmap(pszDJVFileName, pBitmap, sizeof(BITMAPHANDLE), 0, ORDER_RGB, NULL, NULL);

   return nRet;
}