my app is mfc CDialog based. CImageView is inherited from CScrollView. my images are 1600x 1000. my client area is smaller than image size. I like to get the pixel coordinate that I left click on or move mouse on.
void CImageView::OnLButtonDown(UINT nFlags, CPoint pt)
{
CString s;
s.Format("%d %d", pt.x,pt.y);
AfxMessageBox(s);
}
If I scroll the vertical and horizontal bars all the way to the bottom and right respectively, i can view the pixel in most bottom right corner but its coordinate (x,y) is not correct, it is smaller than the 1600x1000. How can i get the correct pixel coordinate if scroll bars are moved?. It seems as the scroll bars get moved, the 1,1 pixel location moves as well.