LRasterPaint::RegionScale

#include "Ltwrappr.h"

L_INT LRasterPaint::RegionScale(nHScaleFactor, nVScaleFactor, nAlignment, phDestRgn)

Scales a region.

Parameters

L_INT nHScaleFactor

Horizontal scale factor. Valid values are between 1 and 10000. For example:

Value Meaning
100 The same dimensions.
110 1.1 times the original dimensions.
120 1.2 times the original dimensions.
10000 100 times the original dimensions.
99 0.99 times the original dimensions.
98 0.98 times the original dimensions.
1 0.01 times the original dimensions.

L_INT nVScaleFactor

Vertical scale factor. Valid values are between 1 and 10000. For example:

Value Meaning
100 The same dimensions.
110 1.1 times the original dimensions
120 1.2 times the original dimensions.
10000 100 times the original dimensions.
99 0.99 times the original dimensions.
98 0.98 times the original dimensions.
1 0.01 times the original dimensions.

PAINTALIGNMENT nAlignment

A value that determines how the scaled region will be aligned with respect to the original region. For a list of possible values, refer to PAINTALIGNMENT.

pHRGN phDestRgn

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 user is responsible for deleting the resulting region.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LRasterPaint_RegionScaleExample( 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, 250, 110, 350, 210 ) ; 
 
   /* Use the current region properties and the current painting  
       transformations to create an ellipse region */ 
   nRet = rstp.RegionEllipse ( pDC->m_hDC, &rcRegion, &hDestRgn ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Display the resulted region */ 
 
   FrameRgn ( pDC->m_hDC, hDestRgn, ( HBRUSH ) GetStockObject ( BLACK_BRUSH ), 1, 1 ) ; 
 
   /* Scale the region */ 
 
   nRet = rstp.RegionScale (300, 300,  
                            ( PAINTALIGNMENT ) (PAINT_ALIGNMENT_HCENTER | PAINT_ALIGNMENT_VCENTER),  
                            &hDestRgn ) ;  
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Display the scaled 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 21.0.2020.8.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS DigitalPaint C++ Class Library Help