L_SetPLTOptions

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetPLTOptions(pOptions)

pFILEPLTOPTIONS pOptions;

/* pointer to a structure */

Sets the file options used by LEADTOOLS when loading HPGL files.

Parameter

Description

pOptions

Pointer to a structure that contains the options to use when loading HPGL files.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The nSize member of the FILEPLTOPTIONS structure must be set before calling this function. If an HPGL file is loaded without first calling this function, the following default values will be used:

FILEPLTOPTIONS Member:

Default value:

PenWidth[0]

1

PenWidth[1]

1

PenWidth[2]

1

PenWidth[3]

1

PenWidth[4]

1

PenWidth[5]

1

PenWidth[6]

1

PenWidth[7]

1

PenColor[0]

0x00FFFFFF

PenColor[1]

0x00000000

PenColor[2]

0x000000FF

PenColor[3]

0x0000FF00

PenColor[4]

0x0000FFFF

PenColor[5]

0x00FF0000

PenColor[6]

0x00FF00FF

PenColor[7]

0x00FFFF00

bPenColorOverride

FALSE

The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.

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

See Also

Functions:

L_GetPLTOptions

Topics:

Raster Image Functions: Loading Files

 

Loading and Saving Images

 

Using Color Values in LEADTOOLS

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

Example

/* This example loads a PLT file, with a pen widths and pen colors
   defined by the user */
void LoadPLTFile

   L_TCHAR           *pszPLTFileName, 
   pBITMAPHANDLE    pBitmap,
   L_INT             *pPenWidths,
  COLORREF                *pPenColors
)
{
   FILEPLTOPTIONS PltOptions;
   L_INT  nPen;

   /* Get the current PLT options */   
   L_GetPLTOptions(&PltOptions, sizeof(FILEPLTOPTIONS));

   for ( nPen = 0; nPen <  8; nPen++ )
   { 
      /*Change pen width */
      PltOptions.PenWidth[nPen] = pPenWidths[nPen];

      /* Change pen color*/
      PltOptions.PenColor[nPen] = pPenColors[nPen];
   }

   /* Set new PLT options */
   L_SetPLTOptions(&PltOptions);

   /* Now load the PLT file */
   L_LoadBitmap(pszPLTFileName, 
                   pBitmap,
                   sizeof(FILEPLTOPTIONS),
                   0,
                  ORDER_RGB,
                  NULL, 
                  NULL );
}