#include "l_bitmap.h"
L_LTDIS_API L_INT L_SetBitmapRgnCurve(pBitmap, pXForm, pCurve, uCombineMode)
Creates or updates the bitmap region by adding a curved region.
Pointer to the bitmap handle referencing the bitmap where the region is to be created or updated.
Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.
If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to the bitmap's view perspective.
Pointer to the CURVE structure that specifies the curve region. You specify the structure using device context coordinates, and LEADTOOLS translates the coordinates using the values specified in the pXForm
parameter.
Flag that indicates the action to take regarding the existing bitmap region, if one is defined. For descriptions of the possible values, refer to Creating a Bitmap Region.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Before calling this function, declare an RGNXFORM structure and set its values, which LEADTOOLS uses to translate between device context coordinates and bitmap coordinates. For details about how the structure works refer to the RGNXFORM structure description. For a description of common usage, refer to Translating Coordinates for a Bitmap Region.
To update an existing region, specify how the new region is to be combined with the existing one, in the uCombineMode
parameter. For descriptions of the possibilities, refer to Creating a Bitmap Region.
Required DLLs and Libraries
Win32, x64.
This sample creates a smooth region that goes through five points, and inverts the region.
L_INT SetBitmapRgnCurveExample(pBITMAPHANDLE pBitmap)
{
L_INT nRet;
CURVE Curve;
POINT points[5];
//Define the points of the curve
points[0].x = 30;
points[0].y = 30;
points[1].x = 30;
points[1].y = 200;
points[2].x = 130;
points[2].y = 130;
points[3].x = 75;
points[3].y = 75;
points[4].x = 130;
points[4].y = 30;
Curve.uStructSize = sizeof(CURVE);
Curve.nType = CURVE_STANDARD;
Curve.nPointCount = 5;
Curve.pPoints = points;
Curve.uFillMode = L_POLY_WINDING;
Curve.dTension = 0.5;
Curve.nClose = CURVE_CLOSE;
Curve.nReserved = 0;
nRet = L_SetBitmapRgnCurve(pBitmap, NULL, &Curve, L_RGN_SET);
if(nRet != SUCCESS)
return nRet;
//Do something with the region
nRet = L_InvertBitmap(pBitmap, 0);
if(nRet != SUCCESS)
return nRet;
//When finished, free the region
L_FreeBitmapRgn(pBitmap);
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document