L_SetVectorOptions

#include "l_bitmap.h"

L_LTFIL_API L_INT L_SetVectorOptions(pOptions);

pVECTOROPTIONS pOptions;

/* pointer to a structure */

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

Parameter

Description

pOptions

Pointer to a structure containing the options for loading vector files.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The uStructSize member of the VECTOROPTIONS structure must be set before calling this function. If a vector file is loaded without first calling this function, the following default values will be used:

 

VECTOROPTIONS Member:

Default value:

VEC2DOPTIONS.nViewWidth

0 pixels

VEC2DOPTIONS.nViewHeight

0 pixels

VEC2DOPTIONS.ViewMode

VECTORVIEWMODE_USE_BEST

nBitsPerPixel

0

bForceBackgroundColor

FALSE

BackgroundColor

0

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

A vector image file usually does not have a physical size. The user can specify a viewport (physical size up to which the drawing can be rendered) using nViewHeight and nViewWidth. How the drawing is rendered inside this viewport depends on which ViewMode isset. The default viewport size is 640x480 pixels.

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

Win32, x64.

See Also

Functions:

L_GetVectorOptions

Topics:

Vector Images

For a list of functions that utilize the VECTOROPTIONS structure, refer to Functions Utilizing the VECTOROPTIONS structure.

Example

This example loads a vector file, using the vector options defined by the user.

L_INT SetVectorOptionsExample(L_TCHAR	    *pszVectorFileName,
                                  pVECTORHANDLE  pVector,
                                  COLORREF		 clBackground,
                                  L_INT			 nBitsPerPixel,
                                  L_INT		     nViewWidth,
                                  L_INT			 nViewHeight)
{
   L_INT nRet;
   VECTOROPTIONS VectorOptions;

   /* Get the current vector options */
   nRet = L_GetVectorOptions(&VectorOptions,sizeof(VECTOROPTIONS));
   if(nRet != SUCCESS)
      return nRet;

   /*Change vector options */
   VectorOptions.bForceBackgroundColor = TRUE;
   VectorOptions.BackgroundColor = clBackground;
   VectorOptions.nBitsPerPixel = nBitsPerPixel;
   VectorOptions.Vec2DOptions.ViewMode = VECTORVIEWMODE_USE_WIDTH_HEIGHT;
   VectorOptions.Vec2DOptions.nViewWidth = nViewWidth;
   VectorOptions.Vec2DOptions.nViewHeight = nViewHeight;

   /* Set new vector options */
   nRet = L_SetVectorOptions(&VectorOptions);
   if(nRet != SUCCESS)
      return nRet;

   /* Now load the vector file */
   nRet = L_VecLoadFile(pszVectorFileName, pVector,NULL, NULL);
   if(nRet != SUCCESS)
      return nRet;

   return SUCCESS;
}