L_SetVectorOptions

#include "l_bitmap.h"

L_LTFIL_API L_INT L_SetVectorOptions(pOptions);

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

Parameters

pVECTOROPTIONS pOptions

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

Returns

Value Meaning
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

Platforms

Win32, x64.

See Also

Functions

Topics

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; 
} 

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help