请给出代码,谢谢,光敲字就免了吧

解决方案 »

  1.   

    敲字也有用的如果不想自己用椭圆方程计算的话可以用DGI+的GraphicsPath的IsVisible方法,判断一个点是否在这个路径中你只需要建一个GraphicsPath对象,往里面加一个椭圆,再判断就可以了
      

  2.   

    回复楼上的,这段圆弧,怎么计算,谢谢。
    pDC->Arc(100, 300, 300, 400, 170, 350, 150, 390);
      

  3.   

    叫你用GraphicsPath,还不听话
    GraphicsPath path;
    path.AddArc(0, 0, 100, 100, 0, 180);//添加一个圆弧 Pen pen(Color(0, 0, 0));//创建宽度为1的画笔
    Point pt(50, 100);//指定要判断的点
    if (path.IsOutlineVisible(pt, &pen) && !path.IsVisible(pt)) //如果在圆弧上
    {
    MessageBox("A1");
    }
      

  4.   

    叫你用GraphicsPath,还不听话
    GraphicsPath path;
    path.AddArc(0, 0, 100, 100, 0, 180);//添加一个圆弧 Pen pen(Color(0, 0, 0));//创建宽度为1的画笔
    Point pt(50, 100);//指定要判断的点
    if (path.IsOutlineVisible(pt, &pen) && !path.IsVisible(pt)) //如果在圆弧上
    {
    MessageBox("A1");
    }
      

  5.   

    楼上我使用GDI+编译程序时候报出一大堆错误,好像跟STL有冲突。
    d:\my program\code common\gdi+\gdiplusflat.h(267) : error C2955: 'iterator' : use of class template requires template argument list
            c:\program files\microsoft visual studio\vc98\include\utility(71) : see declaration of 'iterator'
    d:\my program\code common\gdi+\gdiplusflat.h(270) : error C2955: 'iterator' : use of class template requires template argument list
            c:\program files\microsoft visual studio\vc98\include\utility(71) : see declaration of 'iterator'

      

  6.   

    都是 using namespace 惹的祸,谢谢楼上的,另外我还顺便学了GDI+,不错,以后打算不用GDI了……
      

  7.   

    GDI+速度不是一般的慢GDI可快得多,如果图形不要求特别细腻,还是用GDI吧
      

  8.   

    对了,楼上的,我这里还有个问题,解决马上揭帖。
    那就是我是用ARC绘制弧形的,可是GDI+的DRAWARC绘制方法跟GDI的不一样,最后的参数是弧度,我搞不明白GDI的弧线开始点跟结束点该怎样个换算关系,谢谢。
      

  9.   

    搞了一晚上,发现GDI+的一个重大缺陷,那就是他必须要在一个正规的矩形内部绘制图像,可是我的图形有好多是不正规图形的,用不了啊,唉。