L_PntGetTransformation

#include "LtPnt.h"

L_INT EXT_FUNCTION L_PntGetTransformation(pPaint, pXForm)

pPAINTHANDLE pPaint;

/* pointer to a paint handle */

pPAINTXFORM pXForm;

/* pointer to a structure */

Gets the current transformation information for the toolkit.

Parameter

Description

pPaint

Pointer to a paint handle.

pXForm

Pointer to a PAINTXFORM structure to be updated with the current painting transformations.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The transformation information is used for translating from external coordinates, such as mouse position, to the device context (DC) and/or bitmap coordinates.

Required DLLs and Libraries

LTPNT

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_PntSetTransformation, L_PntGetDCExtents, L_PntSetDCExtents, L_PntSetMetrics

Topics:

DigitalPaint Functions: Transforming External Coordinates

 

Setting General DigitalPaint Information

Example

L_INT OnPaintShape ( pPAINTHANDLE pPaint, HWND hWnd, pBITMAPHANDLE pBitmap )
{
   HDC        hDC ;
   RECT       rcView ;
   RECT       rcShapeRect ;
   PAINTXFORM PntXForm ;
   
   /* Get the Current painting transformations  */
   L_PntGetTransformation ( pPaint, &PntXForm ) ; 

   rcView.left   = - PntXForm.nXOffset ; 
   rcView.top    = - PntXForm.nYOffset ; 
   rcView.right  = rcView.left + MulDiv ( BITMAPWIDTH ( pBitmap ),  PntXForm.nZoom, 100 ) ;
   rcView.bottom = rcView.top  + MulDiv ( BITMAPHEIGHT ( pBitmap ), PntXForm.nZoom, 100 ) ;
   
   /* Get the device context */
   hDC = GetDC ( hWnd ) ;

   /* paint the bitmap */
    L_PaintDC( hDC, pBitmap, NULL, NULL, &rcView, NULL, SRCCOPY ) ;

   /* Set the rectangle coordinates with respect to the DC dimensions*/
   SetRect ( &rcShapeRect, 10, 10, 150, 150 ) ;

   /* Use the current shape properties to draw a rectangle to DC (hDC) */
   L_PntDrawShapeRectangle ( pPaint, hDC, &rcShapeRect ) ;
   
   /* Release the device context */
   ReleaseDC ( hWnd, hDC ) ;

   return SUCCESS ;
}