#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. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
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
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. |
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;
}