MFC中有个CRecTracker可以很方便的通过编辑来改变图形,请问有没有可以运行通过一个手柄来旋转图形的类,如果没有,该怎么实现呢?
  对于一个矩形,我的想法是根据角度算出四点的坐标,然后四次画直线来生成,但这样就没办法通过拖拉改变大小了,我希望有个从CRectTracker派生出来的实现

解决方案 »

  1.   

    GUI+ or DirectX or OpenGL
      

  2.   

    vc++6.0数字图像处理
    GUI+ or DirectX or OpenGL
      

  3.   

    使用gdi+
    Point destinationPoints[] = {
       Point(200, 20),   // destination for upper-left point of original
       Point(110, 100),  // destination for upper-right point of original
       Point(250, 30)};  // destination for lower-left point of original
    Image image(L"Stripes.bmp");
    // Draw the image unaltered with its upper-left corner at (0, 0).
    graphics.DrawImage(&image, 0, 0);
    // Draw the image mapped to the parallelogram.
    graphics.DrawImage(&image, destinationPoints, 3); 
    简单说一下使用gdi+的方法
    在stdafx.h加入
    #include "gdiplus.h"
    #pragma comment(lib,"gdiplus.lib");
    using namespace Gdiplus;在InitInstance中加入
    GdiplusStartupInput gdiplusStartupInput;

    GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
    在ExitInstance加入
    GdiplusShutdown(gdiplusToken);
    变量gdiplusToken是CXXXAPP的成员变量
      

  4.   

    当然还有很多关于图形的操作,请查看msdn关于gdi+的帮助
      

  5.   

    如果用OPENGL来做的话比较简单,只要一个语句
    void glRotated(  GLdouble angle,  GLdouble x,  GLdouble y,  GLdouble z);
    其中angle是角度,x,y,z,指定了一个向量作为轴,例如x=0;y=0;z=1.0;表示Z轴。