LImageViewerCell::GetBitmapPixel

Summary

Gets the bitmap pixel associated with the specified POINT structure.

Syntax

#include "ltwrappr.h"

L_INT LImageViewerCell::GetBitmapPixel(nSubCellIndex, pSrcPoint, pBitmapPoint, uFlags)

Parameters

L_INT 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.

LPPOINT pSrcPoint

Pointer to the POINT structure that specifies the point to get the corresponding bitmap coordinates. Coordinates are relative to the associated cell area.

LPPOINT pBitmapPoint

Pointer to the POINT structure to be updated with the bitmap coordinates that correspond to the specified point pSrcPoint.

L_UINT uFlags

Reserved for future use. Pass 0.

Returns

Value Meaning
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 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

See Also

Functions

Topics

Example

this example draw dots on the image when clicking on it using the left mouse button.

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_GetBitmapPixelExample(LImageViewerCell& ImageViewerCell) 
{ 
   ImageViewerCell.EnableMouseCallBack( TRUE); 
 
   return SUCCESS; 
} 

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Medical Image Viewer C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.