求助:
afx_msg void OnLButtonDown(UINT,CPoint point)
    {
        SetCapture();
        LogicalCoor(&point);
        shape->sPoint=shape->ePoint=point;    
    }
    
    afx_msg void OnMouseMove(UINT,CPoint point)
    {
        if(this==GetCapture())
        {
            CClientDC dc(this);
            dc.SetROP2(R2_NOT);            OnPrepareDC(&dc);
            LogicalCoor(&point);            shape->draw(dc,width,lcolor,fcolor);
            shape->ePoint=point;
            shape->draw(dc,width,lcolor,fcolor);
        }
    }    afx_msg void OnLButtonUp(UINT,CPoint point)
    {
        if(this==GetCapture())
        {
            LogicalCoor(&point);
            CClientDC dc(this);
            shape->ePoint=point;
            //shape->draw(dc,width,lcolor,fcolor);            MyDocument *doc=(MyDocument *)GetDocument();
            GraphicObject obj(shape->GetShapeNum(),width,lcolor,fcolor,shape->sPoint,shape->ePoint);            
            doc->AddObject(obj);            PhysicalCoor(&shape->sPoint);
            PhysicalCoor(&shape->ePoint);
            CRect rect(shape->sPoint,shape->ePoint);
            rect.NormalizeRect();
            rect.InflateRect(5,5);
            InvalidateRect(&rect);
            ReleaseCapture();
        }
    }
    
    说明:这是一个带有滚动条的简单绘图程序。GraphicObject是保存形状对象的类。
    问题:1.这是一个包含滚动条的窗口,它要进行逻辑坐标和物理坐标的转换,其中主要集中在OnLButtonDown,OnMouseMove,OnLButtonUp这3个函数中。请问什么时候需要进行坐标的转换。2.在OnLButtonUp这个函数中OnPrepareDC(&dc);LogicalCoor(&point);为什么连着写了这2个,意思是什么。3.在OnMouseMove函数中使用了dc.SetROP2(R2_NOT); //设置绘图模式
        shape->draw(dc,width,lcolor,fcolor);//画出形状对象
        shape->ePoint=point;
        shape->draw(dc,width,lcolor,fcolor);//再画出形状对象
    为什么在OnLButtonUp中,将其注释掉了//shape->draw(dc,width,lcolor,fcolor);
这里是如何确定最终的图形的。我不能理解,因为它的绘图模式是R2_NOT,是绘图动作与屏幕的底色相反。在mousemove中连画了2次就造成图形被清除的效果,为什么在lbuttonup中却注释掉那个画图的动作。