Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
Working with the Existing Bitmap Region
You can save a region in the alpha channel of a 16- or 32-bit file. For an example, refer to L_SetBitmapAlpha.
You can use the L_BitmapHasRgn function to see if a bitmap has a region. If the bitmap has a region, you can do the following with it:
Use L_FrameBitmapRgn to outline the region.
Display the region using functions described in Displaying a Region.
Use L_GetBitmapRgnHandle to create a Windows region that is a snapshot of the bitmap region.
Use L_OffsetBitmapRgn to move the region.
Use L_GetBitmapRgnArea, L_GetBitmapRgnBounds, and L_IsPtInBitmapRgn to get information about the region's size and location.
Use L_ColorBitmapRgn to display a filled, color representation of a region.
Use L_FreeBitmapRgn to free the region.
Determine the number of maximum number of segments present in any row in the region by calling L_GetBitmapClipSegmentsMax. Once this is known, a buffer can be allocated and the segments can be retrieved using the L_GetBitmapClipSegments function.
To create a new region, or update an existing region, based on either an HSV range or an RGB range, use L_SetBitmapRgnColorHSVRange or L_SetBitmapRgnColorRGBRange. To convert between HSV and RGB color space, use the L_HSVtoRGB and the L_RGBtoHSV functions.
To create a new curve region, or update an existing region with a curve region, use L_SetBitmapRgnCurve.
To resize a bitmap region a specific number of pixels, use the L_ResizeBitmapRgn function.
Use L_HolesRemovalBitmapRgn to remove holes from a bitmap region.
Regions are not supported on Windows CE.
Related Topics