Available in LEADTOOLS Medical Imaging toolkits. |
LImageViewerCell::GetBitmapPixel
#include "ltwrappr.h"
L_INT LImageViewerCell::GetBitmapPixel(nSubCellIndex, pSrcPoint, pBitmapPoint, uFlags)
L_INT nSubCellIndex; |
/* index into the image list attached to the cell */ |
LPPOINT pSrcPoint; |
/* pointer to a POINT structure */ |
LPPOINT pBitmapPoint; |
/* address of the POINT structure to be updated */ |
L_UINT uFlags; |
/* reserved for future */ |
Gets the bitmap pixel associated with the specified POINT structure.
Parameter |
Description |
nSubCellIndex |
A zero-based index into the image list attached to the cell. This sub-cell contains the image that contains the bitmap. Pass -2 to refer to the selected sub-cell. |
pSrcPoint |
Pointer to the POINT structure that specifies the point to get the corresponding bitmap coordinates. Coordinates are relative to the associated cell area. |
pBitmapPoint |
Pointer to the POINT structure to be updated with the bitmap coordinates that correspond to the specified point pSrcPoint. |
uFlags |
Reserved for future use. Pass 0. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function will return the value of the pixel that correspond the the given pSrcPoint. If the pSrcPoint value falls outside the range of valid coordinates for the bitmap, the returned Point will be -1, -1.
Required DLLs and Libraries
LTIVW For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Example
this example draw dots on the image when clicking on it using the left mouse button.
#if defined LTV17_CONFIG class LImageViewerChild2 :public LImageViewerCell { virtual L_INT MouseCallBack(L_UINT uMessage, pDISPCONTAINERCELLINFO pCellInfo); } ; L_INT LImageViewerChild2::MouseCallBack(L_UINT uMessage, pDISPCONTAINERCELLINFO pCellInfo) { UNREFERENCED_PARAMETER(pCellInfo); POINT ptBitmapPoint; BITMAPHANDLE Bitmap; LBitmap BitmapHandle; switch(uMessage) { case WM_LBUTTONDOWN: { POINT ptPoint = {pCellInfo->nX, pCellInfo->nY}; GetBitmapPixel( pCellInfo->nSubCellIndex, &ptPoint, &ptBitmapPoint, 0); GetBitmapHandle( pCellInfo->nSubCellIndex, &Bitmap, 0); BitmapHandle.SetHandle(&Bitmap); BitmapHandle.PutPixelColor(ptBitmapPoint.y, ptBitmapPoint.x, RGB(255, 255, 255)); pBITMAPHANDLE pBitmap = BitmapHandle.GetHandle(); SetBitmapHandle( pCellInfo->nSubCellIndex, pBitmap, TRUE, 0); BitmapHandle.SetHandle(NULL, FALSE); } break; } return SUCCESS; } L_INT LImageViewer_GetBitmapPixel(LImageViewerCell& ImageViewerCell) { ImageViewerCell.EnableMouseCallBack( TRUE); return SUCCESS; } #else class LImageViewerChild2 :public LImageViewer { virtual L_INT MouseCallBack(L_UINT uMessage, pDISPCONTAINERCELLINFO pCellInfo); } ; L_INT LImageViewerChild2::MouseCallBack(L_UINT uMessage, pDISPCONTAINERCELLINFO pCellInfo) { UNREFERENCED_PARAMETER(pCellInfo); POINT ptBitmapPoint; BITMAPHANDLE Bitmap; LBitmap BitmapHandle; switch(uMessage) { case WM_LBUTTONDOWN: { POINT ptPoint = {pCellInfo->nX, pCellInfo->nY}; GetBitmapPixel( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, &ptPoint, &ptBitmapPoint, 0); GetBitmapHandle( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, &Bitmap, 0); BitmapHandle.SetHandle(&Bitmap); BitmapHandle.PutPixelColor(ptBitmapPoint.y, ptBitmapPoint.x, RGB(255, 255, 255)); pBITMAPHANDLE pBitmap = BitmapHandle.GetHandle(); SetBitmapHandle( pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, pBitmap, TRUE, 0); BitmapHandle.SetHandle(NULL, FALSE); } break; } return SUCCESS; } L_INT LImageViewer_GetBitmapPixel(LImageViewer& ImageViewer) { ImageViewer.EnableMouseCallBack( TRUE); return SUCCESS; } #endif // LTV17_CONFIG