LBitmapRgn::SetRgnCurve

Summary

Creates or updates the region of the class object's associated bitmap by adding a curved region.

Syntax

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnCurve(pCurve)

Parameters

pCURVE pCurve

Pointer to the CURVE structure that specifies the curve region. The structure is specified using device context coordinates, and LEADTOOLS translates the coordinates using the values specified in the LBitmapRgn::SetRgnXForm parameter.

Returns

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

Comments

To update an existing region, use the LBitmapRgn::SetRgnCombineMode function to specify how the new region is to be combined with the existing one. For descriptions of the possibilities, refer to Creating a Bitmap Region.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LBitmapRgn__SetRgnCurveExample(LBitmap & Bitmap) 
{ 
   L_INT nRet; 
   CURVE curve; 
   POINT pt[5]; 
   L_INT nWidth = Bitmap.GetWidth(); 
   L_INT nHeight = Bitmap.GetHeight(); 
   LBitmapRgn Region; 
 
   pt[0].x = nWidth / 4; 
   pt[0].y = nHeight / 4; 
   pt[1].x = nWidth / 4; 
   pt[1].y = 3 * nHeight / 4; 
   pt[2].x = 3 * nWidth / 4; 
   pt[2].y = 3 * nHeight / 4; 
   pt[3].x = nWidth / 2; 
   pt[3].y = nHeight / 2; 
   pt[4].x = 3 * nWidth / 4; 
   pt[4].y = nHeight / 4; 
 
   curve.uStructSize=sizeof(CURVE); 
   curve.nType = CURVE_STANDARD; 
   curve.nPointCount = sizeof(pt) / sizeof(pt[0]); 
   curve.pPoints = pt; 
   curve.uFillMode = L_POLY_WINDING; 
   curve.dTension = 0.5; 
   curve.nClose = CURVE_CLOSE; 
   curve.nReserved = 0; 
 
   Region.SetBitmap(&Bitmap); 
   nRet =Region.SetRgnCurve(&curve); 
   if(nRet !=SUCCESS) 
      return nRet; 
   nRet =Bitmap.Invert(); 
   if(nRet !=SUCCESS) 
      return nRet; 
   nRet =Region.Free(); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

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