Removes all the holes in a region.
L_LTIMGEFX_API L_INT L_HolesRemovalBitmapRgn(pBitmap, uFlags)
Pointer to the bitmap handle referencing the bitmap to be changed.
Reserved for future use. Must be 0.
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
This function is designed to work on bitmaps that have a region. It removes the holes from the bitmaps region. If this function is used with a bitmap that does not have a region, the "Invalid Parameter" error is returned.
To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.
This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available in the Document and Medical Imaging toolkits.
This function supports 32-bit grayscale images.
Win32, x64, Linux.
This example loads a bitmap, defines a region on it after converting to 1bit black and white, and applies the
holes removal filter to remove small white or black segments
/* Load the bitmap, keeping the bits per pixel of the file */
nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("IMAGE1.CMP")), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/*convert to 1-bit black and white*/
nRet = L_ColorResBitmap(&LeadBitmap, &LeadBitmap, sizeof(BITMAPHANDLE), 1,CRF_FIXEDPALETTE,
NULL, NULL, 0, NULL, NULL);
/*Set the region around the black or white region according to (0,0) color*/
nRet = L_SetBitmapRgnMagicWand(&LeadBitmap,0, 0, RGB(0,0,0), RGB(25,25,25), L_RGN_SET);
/*Remove holes around the black or white regions*/
nRet = L_HolesRemovalBitmapRgn (&LeadBitmap, 0);
/* Fill the region with balck color*/
L_SaveBitmap(MAKE_IMAGE_PATH(TEXT("Result.BMP")), &LeadBitmap, FILE_BMP, 24, 0, NULL);
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries