LVectorBase::ApplyTransformation
#include "ltwrappr.h"
virtual L_INT LVectorBase::ApplyTransformation(L_VOID)
Applies the current transformation to the vector image. This function is available in the LEADTOOLS Vector Imaging Pro Toolkit.
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function will apply current transformation (Rotation, scaling and translation) to the vector image. The vector image objects will be changed.
After a call to this function, rotation, scaling and translation values will be reset.
Not supported in DirectX engine.
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
Example
This example opens an image, rotates it, and saves the result as a .dxf file.
The vector is saved as transformed.
L_INT LVectorBase__ApplyTransformationExample(HWND hWnd) { L_INT nRet; LVectorBase Vector; RECT rect; //Load the drawing nRet = Vector.Load(TEXT("C:\\Program Files\\LEAD Technologies, Inc\\LEADTOOLS 15.0\\Images\\skull.dxf")); if(nRet != SUCCESS) return nRet; //Attach to window nRet = Vector.AttachToWindow(hWnd); if(nRet != SUCCESS) return nRet; //Set viewport GetClientRect(hWnd, &rect); nRet = Vector.SetViewport(&rect); if(nRet != SUCCESS) return nRet; //Rotate VECTORPOINT rotatePoint; nRet = Vector.GetRotation(&rotatePoint); if(nRet != SUCCESS) return nRet; rotatePoint.x += 30.0F; rotatePoint.y -= 100.0F; rotatePoint.z += 50.0F; Vector.SetRotation(&rotatePoint,NULL,NULL); //Make transformations apply to save nRet = Vector.ApplyTransformation(); if(nRet != SUCCESS) return nRet; //Save Vector.SetFileName(TEXT("C:\\Program Files\\LEAD Technologies, Inc\\LEADTOOLS 15.0\\Images\\image.dxf")); nRet = Vector.Save(FILE_DXF); if(nRet != SUCCESS) return nRet; return SUCCESS; }