请问如何修改CDC的x,y坐标轴方向?

解决方案 »

  1.   

    我用
    pDC1->SetMapMode(MM_ISOTROPIC);
    pDC1->SetWindowOrg(0,0);
    pDC1->SetViewportOrg(20,200 );
    改了设备,逻辑坐标系的对应原点
    问题是现在好像显示出来的图像缩小的。怎么办呢?
      

  2.   

    CRect rectClient;
    GetClientRect(rectClient);

    //设定 映射模式为MM_ANISOTROPIC
    pDC->SetMapMode(MM_ISOTROPIC);

    pDC->SetWindowExt(10*rectClient.right,10*rectClient.bottom );

    pDC->SetViewportExt (rectClient.right ,-rectClient.bottom );

    //用SetWin dowExt和SetViewportExt函数设定窗口为与原长宽等比例长宽

    //设定逻辑坐标原点为窗口中心
    //pDC-> SetViewportOrg(rectClient.right/2,rectClient.bottom/2 );
    //设定逻辑坐标原点为窗口左下角
    pDC->SetViewportOrg(0,rectClient.bottom ); pDC->MoveTo( 0, 0 );
    pDC->LineTo( 10*rectClient.Width()/2, 10*rectClient.Height()/2 );