L_VecGetViewport

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetViewport(pVector, pViewport)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

RECT L_FAR * pViewport;

/* pointer to a structure */

Gets the current view port.

Parameter

Description

pVector

Pointer to a vector handle.

pViewport

Pointer to a RECT structure to be updated with the current view port data.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Use this function to get the view port associated with the specified vector handle.

If pVector is attached to a window, you must call this function when processing WM_SIZE messages, since the VECTOR library needs to know when the window size has changed (DirectX), or when the double buffer mode is selected in the current VECTOR engine.

This function and L_VecSetCamera are required to complete the projection process from the vector image onto a 2D surface.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSetViewport, L_VecSetPan, L_VecGetPan

Example

/* This example will get current view port value and shows it in a message box */

void ShowViewport( pVECTORHANDLE pVector )
{
   RECT     rect;
   L_TCHAR   szBuffer[ 80 ];

   /* Get viewport */
   L_VecGetViewport( pVector, &rect );

   /* Format in a buffer */
   wsprintf( szBuffer, TEXT("%d, %d, %d, %d"), rect.left, rect.top, rect.right, rect.bottom );

   /* Show in a message box */
   MessageBox( NULL, szBuffer, TEXT("Viewport"), 0 );
}