Hi all, I dnt know whether its a right forum for this question.If any one can help me it will be helpful to me. I am drawing a rectangle using LeadTools. Here is the code :
void CImageViewerView::OnAnnotationRectanle()
{
m_ImageViewer.SetAction(CONTAINER_ACTION_ANNOTATION_RECTANGLE,CONTAINER_MOUSE_BUTTON_LEFT,FALSE);
m_ImageViewer.EnableActionCallBack(TRUE);
m_ImageViewer.SetAction(110, CONTAINER_MOUSE_BUTTON_RIGHT, DCACTION_ACTIVEONLY);
}
How can i get the co-ordinates 1) m_ImageViewer.SetAction : Sets the rectangle for left mouse button. 2)m_ImageViewer.EnableActionCallBack: Returns if the rectangle is drawn. 3)I want to use GetAnnotationContainer() for returning the co-ordinates.
m_ImageViewer.SetAction(110, CONTAINER_MOUSE_BUTTON_RIGHT, DCACTION_ACTIVEONLY);
This is working fine for me,I am changing the rectangle action to Right Mouse button
Here is the API :
L_INT GetAnnotationContainer(L_INT nCellIndex,L_INT nSubCellIndex,HANNOBJECT * PhAnnContainer,L_UINT uFlags);
I have this in .h file
typedef struct tagDISPCONTAINERCELLINFO
{
L_UINT uStructSize;
L_HDC hDC;
L_INT nCellIndex;
L_INT nSubCellIndex;
RECT rcRect;
RECT rcBitmapRect;
L_INT nX;
L_INT nY;
}
DISPCONTAINERCELLINFO, * pDISPCONTAINERCELLINFO;
When i am trying to use the same
pDISPCONTAINERCELLINFO pCellInfo;
void CImageViewerView::OnAnnotationRectanle()
{
m_ImageViewer.SetAction(CONTAINER_ACTION_ANNOTATION_RECTANGLE,CONTAINER_MOUSE_BUTTON_LEFT,FALSE);
m_ImageViewer.EnableActionCallBack(TRUE);
m_ImageViewer.SetAction(110, CONTAINER_MOUSE_BUTTON_RIGHT, DCACTION_ACTIVEONLY);
m_ImageViewer.GetAnnotationContainer(pCellInfo->nCellIndex, pCellInfo->nSubCellIndex, &PhAnnContainer, CONTAINER_ACTION_ANNOTATION_RECTANGLE);
}
But i am getting memory cannot read for pCellInfo->nCellIndex (Run Time error) If any one knows what i am doing wrong,please help me Thanks raj