#include "l_bitmap.h"
L_LTDIS_API L_INT L_ColorBitmapRgn(hDC, pBitmap, pXForm, crRgnColor)
Highlights a region by displaying a filled, color representation of the region.
Handle to a device context where the image is displayed and where the frame is to appear.
Pointer to the bitmap handle referencing the bitmap that has the region.
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.
Color value to be XORed with colors within a region to determine the new colors for displaying the region. The color corresponding to a particular part of the region is determined as follows:
Region Color Displayed = (color of pixel in region) XOR (crRgnColor)
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.
This function is particularly useful when displaying regions with black and white images. All black pixels in a region are displayed with color crRgnColor, and all white pixels are displayed ~(crRgnColor). For example, suppose that crRgnColor is light green (BGR 0x80FF40). All black pixels in the region are displayed as crRgnColor. All white pixels in the region are displayed as 0xFFFFFF XOR 0x80FF40 = 0x7F00BF, which is purple.
Required DLLs and Libraries
Win32, x64.
The following should be part of the WM_PAINT processing.
L_INT ColorBitmapRgnExample(L_HWND hWnd, pBITMAPHANDLE pBitmap)
{
L_INT nRet;
HDC hdcDraw;
COLORREF crRgnColor = RGB(255,0,0);
if(L_BitmapHasRgn(pBitmap))
{
hdcDraw = GetDC(hWnd);
nRet = L_ColorBitmapRgn(hdcDraw, pBitmap, NULL, crRgnColor);
if(nRet != SUCCESS)
return nRet;
ReleaseDC(hWnd, hdcDraw);
}
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