#include "l_bitmap.h"
L_LTFIL_API L_INT L_2DGetViewMode()
Gets the current view port mode used when loading 3D file formats.
The current view mode. Possible values are:
Value |
Meaning |
L2D_USE_BEST |
Fit the drawing into current viewport width and height. Final image size is less than or equal to viewport size. |
L2D_USE_WIDTH |
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. |
L2D_USE_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. |
L2D_USE_WIDTH_HEIGHT |
Use both the width and the height (stretch image if necessary). Final image size has the same width and height as the current viewport size. |
To set the view mode, use L_2DSetViewMode.
When working with Vector files, you can use the Vector features, available in selected products, or you can use the Raster C API. If you use the Main C API for loading, using the standard loading functions, you can modify the view port and view mode using the following functions:
L_2DGetViewMode
This function may 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
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.
Functions: |
|
|
For Vector files: L_2DSetViewMode, L_2DGetViewport, L_2DSetViewport |
Topics: |
This example gets the current viewport mode and size and shows them in a message box
L_INT Get2DViewModeExample(L_VOID)
{
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 = nRet = L_2DGetViewMode();
nRet = L_2DGetViewport ( &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( NULL, szBuffer, TEXT("Viewport Settings"), MB_OK );
return SUCCESS;
}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET