LRasterPaint::GetTransformation

#include "Ltwrappr.h"

L_INT LRasterPaint::GetTransformation(pXForm)

pPAINTXFORM pXForm;

/* pointer to a structure */

Gets the toolkit's current transformation information.

Parameter

Description

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:

LRasterPaint::SetTransformation, LRasterPaint::GetDCExtents, LRasterPaint::SetDCExtents, LRasterPaint::SetMetrics, Class Members

Topics:

Setting General DigitalPaint Information

Example

L_INT OnPaintShape ( LRasterPaint &rstp, CWnd* pWnd, LBitmap* pBitmap )
{
   CDC* pDC = pWnd->GetDC( ) ;
   RECT rcView ;
   RECT rcShapeRect ;
   PAINTXFORM PntXForm ;
   
   /* Get the Current painting transformations  */
   rstp.GetTransformation ( &PntXForm ) ; 

   rcView.left    = - PntXForm.nXOffset ; 
   rcView.top    = - PntXForm.nYOffset ; 
   rcView.right  = rcView.left + MulDiv ( pBitmap->GetWidth (  ), PntXForm.nZoom, 100 ) ;
   rcView.bottom = rcView.top  + MulDiv ( pBitmap->GetHeight (  ), PntXForm.nZoom, 100 ) ;
   
   /* paint the bitmap */
   pBitmap->Paint( )->SetDC( pDC->m_hDC );
   pBitmap->SetDstRect( &rcView );
   pBitmap->Paint( )->PaintDC();

   /* 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) */
   rstp.DrawShapeRectangle ( pDC->m_hDC, &rcShapeRect ) ;
   
   /* Release the device context */
   pWnd->ReleaseDC( pDC ) ;

   return SUCCESS ;
}