LRasterPaint::RegionTranslate

Summary

Translates ( offsets ) a region.

Syntax

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionTranslate(dx, dy, phRgn)

Parameters

L_INT dx

X-coordinate offset.

L_INT dy

Y-coordinate offset.

pHRGN phRgn

Pointer to the region to be translated. After translation, the toolkit will delete the old region and replace it with the new one.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes

Comments

The values for dx and dy will be used "as is". No transformation will be performed on these values.

The user is responsible for deleting the resulting region.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LRasterPaint_RegionTranslateExample( CWnd* pWnd ) 
{ 
   L_INT          nRet; 
   LRasterPaint   rstp ; 
   CDC*           pDC = pWnd->GetDC() ; 
   RECT           rcRegion ; 
   HRGN           hDestRgn ;  
    
   /* Initiate the Paint toolkit */ 
   nRet = rstp.Initialize ( ); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Set the coordinates with respect to the DC dimensions*/ 
   SetRect ( &rcRegion, 10, 10, 100, 100 ) ; 
 
   /* Use the current region properties and the current painting  
       transformations to create a rectangle region */ 
   nRet = rstp.RegionRect ( pDC->m_hDC, &rcRegion, &hDestRgn) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Translate the region */ 
   nRet = rstp.RegionTranslate (50, 50, &hDestRgn ) ;  
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Display the resulted region */ 
   FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ; 
 
   /*Delete the region */ 
   DeleteObject ( hDestRgn ) ; 
 
   /* Free the paint tools handle */ 
   nRet = rstp.Free ( ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   pWnd->ReleaseDC( pDC ) ; 
 
   return SUCCESS ; 
} 
Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DigitalPaint C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.