LRasterPaint::RegionTranslate
#include "Ltwrappr.h"
L_INT LRasterPaint::RegionTranslate(dx, dy, phRgn)
L_INT dx; |
/* x-direction offset */ |
L_INT dy; |
/* y-direction offset */ |
pHRGN phRgn; |
/* pointer to the region handle */ |
Translates ( offsets ) a region.
Parameter |
Description |
dx |
X-coordinate offset. |
dy |
Y-coordinate offset. |
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
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
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
Example
L_INT RegionTranslateTest ( CWnd* pWnd )
{
LRasterPaint rstp ;
CDC* pDC = pWnd->GetDC() ;
RECT rcRegion ;
HRGN hDestRgn ;
/* Initiate the Paint toolkit */
if ( SUCCESS != rstp.Initialize ( ) )
{
return FAILURE ;
}
/* 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 */
rstp.RegionRect ( pDC->m_hDC, &rcRegion, &hDestRgn) ;
/* Translate the region */
rstp.RegionTranslate (50, 50, &hDestRgn ) ;
/* 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 */
rstp.Free ( ) ;
pWnd->ReleaseDC( pDC ) ;
return SUCCESS ;
}