#include "ltwrappr.h"

static L_INT LFileSettings::GetViewMode2D()

Gets the current view port mode used when loading 3D file formats.


The current view mode. Possible values are:




Fit the drawing into the current viewport width and height. Final image size is less than or equal to the viewport size.


Use the current viewport width. Calculate new height, preserving the aspect ratio. Final image size has the same width as the current viewport width, with the height less than or equal to the current viewport height.


Use the current viewport height. Calculate the new width, preserving the aspect ratio. Final image size has the same height as the current viewport height, with the width less than or equal to the current viewport width.


Use both the width and the height (stretching image if necessary). Final image size has the same width and height as the current viewport size.


To set the view mode, use LFileSettings::SetViewMode2D.

When working with DXF files, you can use the Vector features, available in selected products, or you can use the Main C++ Class Library.

If you use the Main C++ Class Library for loading (using the standard loading functions), you can modify the view port and view mode using the following functions:





This function can be used with the following Vector file formats: DXF, DWG, WMF, EMF, PCT, CGM, DRW, PLT, TIF (with a DXF saved internally) and Intergraph Vector. For more information on these file formats and their availability, refer to LEADTOOLS Vector Formats.

Required DLLs and Libraries

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.


Win32, x64.

See Also


LFileSettings::SetViewMode2D, LFileSettings::GetViewport2D, LFileSettings::SetViewport2D, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetWMFResolution, LFileSettings::SetWMFResolution


Raster Image Functions: Rasterizing Files


Vector Images


L_INT LFileSettings__GetViewMode2DExample(HWND hWnd) 
   L_INT nRet; 
   L_TCHAR szBuffer[ 80 ];     /* buffer to hold the message */ 
   L_INT nViewportMode;       /* current viewport mode */ 
   L_INT nViewportWidth;      /* current viewport width */ 
   L_INT nViewportHeight;     /* current viewport height */ 
   /* Get viewport mode, width and height */ 
   nViewportMode = LFileSettings::GetViewMode2D(); 
   nRet = LFileSettings::GetViewport2D( &nViewportWidth, &nViewportHeight ); 
   if(nRet != SUCCESS) 
      return nRet; 
   /* format into a message box */ 
   wsprintf( szBuffer, 
   TEXT("Viewport mode = %d\nWidth = %d\nHeight = %d"), 
   nViewportMode, nViewportWidth, nViewportHeight ); 
   MessageBox( hWnd, szBuffer, TEXT("Viewport Settings"), 0 ); 
   return SUCCESS; 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C++ Class Library Help