把   __x
    |
    y   
换成    y
        |___x     

解决方案 »

  1.   

    用下面的代码就行了:
    void CMy34View::OnDraw(CDC* pDC)
    {
    CMy34Doc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    if (!pDoc)
    return;
    CRect rect;
    GetClientRect(&rect);pDC->SetMapMode(MM_ANISOTROPIC);
    pDC->SetViewportOrg(rect.left,rect.bottom);
    pDC->SetViewportExt(rect.right,-rect.bottom);
    pDC->SetWindowExt(1000,1000);

    pDC->MoveTo(10,10);
    pDC->LineTo(250,10);
    pDC->MoveTo(10,10);
    pDC->LineTo(10,950);
    }
    红色部分是改坐标系的,下面的LineTo语句是画线语句。
      

  2.   

    改变映射模式就可以了SetMapMode
    MM_ANISOTROPIC   Logical units are converted to arbitrary units with arbitrarily scaled axes. Setting the mapping mode to MM_ANISOTROPIC does not change the current window or viewport settings. To change the units, orientation, and scaling, call the SetWindowExt and SetViewportExt member functions. MM_HIENGLISH   Each logical unit is converted to 0.001 inch. Positive x is to the right; positive y is up. MM_HIMETRIC   Each logical unit is converted to 0.01 millimeter. Positive x is to the right; positive y is up. MM_ISOTROPIC   Logical units are converted to arbitrary units with equally scaled axes; that is, 1 unit along the x-axis is equal to 1 unit along the y-axis. Use the SetWindowExt and SetViewportExt member functions to specify the desired units and the orientation of the axes. GDI makes adjustments as necessary to ensure that the x and y units remain the same size. MM_LOENGLISH   Each logical unit is converted to 0.01 inch. Positive x is to the right; positive y is up. MM_LOMETRIC   Each logical unit is converted to 0.1 millimeter. Positive x is to the right; positive y is up. MM_TEXT   Each logical unit is converted to 1 device pixel. Positive x is to the right; positive y is down. MM_TWIPS   Each logical unit is converted to 1/20 of a point. (Because a point is 1/72 inch, a twip is 1/1440 inch.) Positive x is to the right; positive y is up. 
      

  3.   

    SetMapMode 函数状态: 正式函数 
      函数功能描述:该函数设置指定设备环境的映射方式,映射方式定义了将逻辑单位转换为设备单位的度量单位,并定义了设备的X、Y轴的方向。
      函数原型:int SetMapMode(HDC hdc, int fnMapMode);
    hdc:指向设备环境的句柄。
      fnMapMode:指定新的映射方式,此参数可以是下面列出的任何一个值。
      MM_ANISOTROPIC:逻辑单位转换成具有任意比例轴的任意单位,用SetWindowExtEx和SetViewportExtEx函数可指定单位、方向和比例。
      MM_HIENGLISH:每个逻辑单位转换为0.001英寸,X的正方面向右,Y的正方向向上。
      MM_HIMETRIC:每个逻辑单位转换为0.01毫米,X正方向向右,Y的正方向向上。
      MM_ISOTROPIC:逻辑单位转换成具有均等比例轴的任意单位,即沿X轴的一个单位等于沿Y轴的一个单位,用和函数可以指定该轴的单位和方向。图形设备界面(GDI)需要进行调整,以保证X和Y的单位保持相同大小(当设置窗口范围时,视口将被调整以达到单位大小相同)。
      MM_LOENGLISH:每个逻辑单位转换为0.1英寸,X正方向向右,Y正方向向上。
      MM_LOMETRIC:每个逻辑单位转换为0.1毫米,X正方向向右,Y正方向向上。
      MM_TEXT:每个逻辑单位转换为一个图素,X正方向向右,Y正方向向下。
      MM_TWIPS;每个逻辑单位转换为打印点的1/20(即1/1400英寸),X正方向向右,Y方向向上。
      返回值:如果函数调用成功,返回值指定先前的映射方式,否则,返回值为零,若想获得更多错误信息,请调用GetLastError函数。
      

  4.   

    用setWorldTransform吧,想怎么变就怎么变
      

  5.   


    pDC->SetMapMode(MM_ANISOTROPIC);
    pDC->SetViewportOrg(rect.left,rect.bottom);
    pDC->SetViewportExt(rect.right,-rect.bottom);
    pDC->SetWindowExt(1000,1000);8错。
    先设置映射方式。
    让后设置视口原点。
    设置逻辑坐标如何转换到设备坐标。
    设置窗口原点。