Determines whether the specified pixel is in the bitmap region.
#include "l_bitmap.h"
L_LTDIS_API L_BOOL L_IsPtInBitmapRgn(pBitmap, nRow, nCol)
Pointer to the bitmap handle referencing the bitmap that has the region.
The row number of the pixel.
The column number of the pixel.
Value | Meaning |
---|---|
TRUE | The specified pixel is in the region. |
FALSE | The specified pixel is outside the region. |
This function uses bitmap coordinates to specify the pixel. Therefore, you must account for the view perspective of the bitmap. For more information, refer to Accounting for View Perspective.
Win32, x64, Linux.
L_INT IsPtInBitmapRgnExample(pBITMAPHANDLE LeadBitmap,
L_INT DisplayWidth,
L_INT DisplayHeight,
L_INT DisplayLeft,
L_INT DisplayTop)
{
L_INT nRet;
L_INT BitmapX = 0;
L_INT BitmapY = 0;
/* Translate mouse positions to bitmap coordinates */
BitmapX *= BITMAPWIDTH(LeadBitmap) / (DisplayWidth - DisplayLeft);
BitmapY *= BITMAPHEIGHT(LeadBitmap) / (DisplayHeight - DisplayTop);
/* Adjust for view perspective */
nRet = L_PointToBitmap(LeadBitmap, TOP_LEFT, &BitmapX, &BitmapY);
if (nRet != SUCCESS)
return nRet;
/* Display a message if the point is in the region */
if (L_IsPtInBitmapRgn(LeadBitmap, BitmapY, BitmapX))
_tprintf(TEXT("Notice: Point is in region."));
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