void CddrwDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
// TODO: 在此添加消息处理程序代码和/或调用默认值
CPen* oldPen=NULL;
CRect rect;
CWnd *pWnd = GetDlgItem(IDC_STATIC_picture); //图像控件框的ID
pWnd->GetWindowRect(&rect);
ScreenToClient(&rect);
//先获取鼠标相对于屏幕的绝对坐标
GetCursorPos(&point);
int temp_x = point.x; //为了获取灰度值使用
int temp_y = point.y;
//然后得到static控件的rect坐标
CRect pRect;
pWnd->GetClientRect(&pRect);
//最后把当前鼠标的坐标转化为相对于rect的坐标(相对坐标)
pWnd->ScreenToClient(&point);
int x = point.x; //相对坐标
int y = point.y;
SetDlgItemInt(IDC_EDIT1, x); //写入坐标值x
Se