Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS Vector C++ Class Library Help

LVectorBase::GetCamera

Show in webframe

#include "ltwrappr.h"

virtual L_INT LVectorBase::GetCamera(pVectorCamera)

pVECTORCAMERA pVectorCamera;

/* pointer to a structure */

Gets the current camera values.

Parameter

Description

pVectorCamera

Pointer to a VECTORCAMERA structure to be updated with the current camera values.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function will get the current viewing camera.

The camera is used with the view port to determine how the drawing will be projected into the destination DC when using LVectorBase::Paint.

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:

LVectorBase::SetCamera, LVectorBase::Paint

Topics:

Manipulating the Camera

 

Vector Images: Viewing a Vector Image

Example

#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName
/* LVectorBase::GetCamera() */
/* LVectorBase::SetCamera() */
L_INT LVectorBase__GetCameraExample(HWND hWnd)
{
   L_INT          nRet;
   VECTORCAMERA   camera;
   L_TCHAR        szTemp[300];
   LVectorBase    Vector;
   nRet = Vector.Load(MAKE_IMAGE_PATH(TEXT("random.dxf")));
   if(nRet != SUCCESS)
      return nRet;
   nRet = Vector.GetCamera(&camera);
   if(nRet != SUCCESS)
      return nRet;
   wsprintf(szTemp,
            TEXT("New Camera\nTheta[%f]\nPhi[%f]\nLookAt[%f,%f,%f]\nDistance[%lf]\nPerspective[%s]"), 
            camera.Theta,
            camera.Phi,
            camera.LookAt.x,
            camera.LookAt.y,
            camera.LookAt.z,
            camera.Distance,
            camera.bPerspective? TEXT("TRUE"): TEXT("FALSE")
            );
   MessageBox(hWnd, szTemp, TEXT(""), MB_OK);
   camera.Theta +=20;
   nRet = Vector.SetCamera(&camera);
   if(nRet != SUCCESS)
      return nRet;
   wsprintf(szTemp, 
            TEXT("New Camera\nTheta[%f]\nPhi[%f]\nLookAt[%f,%f,%f]\nDistance[%lf]\nPerspective[%s]"), 
            camera.Theta,
            camera.Phi,
            camera.LookAt.x,
            camera.LookAt.y,
            camera.LookAt.z,
            camera.Distance,
            camera.bPerspective? TEXT("TRUE"): TEXT("FALSE")
            );
   MessageBox(hWnd, szTemp, TEXT(""), MB_OK);
   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.