SetWindowOrg和SetViewportOrg的区别,是是么?请给我详细讲讲或给我个例子好么?

解决方案 »

  1.   

    Sets the viewport origin of the device context. The viewport, along with the device-context window, defines how GDI maps points in the logical coordinate system to points in the coordinate system of the actual device. In other words, they define how GDI converts logical coordinates into device coordinates. The viewport origin s the point in the device coordinate system to which GDI maps the window origin, a point in the logical coordinate system specified by the SetWindowOrg member function. GDI maps all other points by following the same process required to map the window origin to the viewport origin. For example, all points in a circle around the point at the window origin will be in a circle around the point at the viewport origin. Similarly, all points in a line that passes through the window origin will be in a line that passes through the viewport origin.我先摆上英文,稍等
      

  2.   

    SetWindowOrg 设置窗口原点
    SetViewportOrg 设置视口原点
      

  3.   

    在Windows下,有5个基本函数决定你绘图时的坐标系:SetMapMode, SetWindowExt, SetWindowOrg, SetViewportExt和SetViewportOrg。在MFC中,这几个函数都是CDC的成员函数。默认的坐标映射方式是MM_TEXT,既每个逻辑单位为1个像素,X轴向右,Y轴向下。如果你仍然采用这个方式,可以使用SetViewportOrg将任意点设置为坐标原点。而如果你想自由地设置坐标原点和逻辑单位大小,就需要使用其他几个函数了。:-)
      

  4.   

    强烈推荐你看看这篇文章http://www.csdn.net/develop/article/12/12013.shtm
      

  5.   

    键模型还是用浮点的好。否则,你的模型会设备相关,或者有舍入误差。http://alphasun.icpcn.com/alphasun/YaCompile/index.htm
      

  6.   

    pDC->SetMapMode(MM_HIENGLISH);
    // pDC->SetViewportOrg(100,100);
    pDC->SetWindowOrg(100,100);
    这样的话会把当前的原点(左上角点)设置为(0,0) pDC->SetMapMode(MM_HIENGLISH);
    pDC->SetViewportOrg(100,100);
    // pDC->SetWindowOrg(100,100);这样的话会把当前的100,100点(像素点)变成坐标原点
      

  7.   

    强烈同意 bluebohe(薄荷)!!!
      

  8.   

    bluebohe(薄荷)兄的基础很扎实啊碰到这些问题,我都是临时翻书呵呵!
      

  9.   

    wqs6(竹山) :
    碰到这些问题,我都是临时翻书me too
    :-)
      

  10.   

    pDC->SetMapMode(MM_HIENGLISH);
    // pDC->SetViewportOrg(100,100);
    pDC->SetWindowOrg(100,100);
    这样的话会把当前的原点(左上角点)设置为(100,100) pDC->SetMapMode(MM_HIENGLISH);
    pDC->SetViewportOrg(100,100);
    // pDC->SetWindowOrg(100,100);这样的话会把当前的100,100点(像素点)变成坐标原点
      

  11.   

    用MM_ANISOTROPIC模式说事比较好。