'getviewsettings'程序卡在这行,怎么解决?

发布时间:2019-08-01 00:41:40

 [Error] 'getviewsettings' was not declared in this scope


int main()

{  

    initgraph(640, 480);

    setcolor(3);  

    setbkcolor(BLACK);     

    struct viewporttype vp;    

    struct PTS points[MAXPTS];  

    int i, j, h, w, xcenter, ycenter;  

    int radius, angle, step;  

    double rads;  

    printf(" MoveTo / LineTo Demonstration" );  

    getviewsettings( &vp ); 

    h = vp.bottom - vp.top;  

    w = vp.right - vp.left;  

    xcenter = w / 2; /* Determine the center of circle */   

    ycenter = h / 2+8;  

    radius = (h - 30) / (AspectRatio * 2)-30;  

    step = 360 / MAXPTS; /* Determine # of increments */   

    angle = 0; /* Begin at zero degrees */   

    for(i = 0 ;i < MAXPTS ;++i )  

    { /* Determine circle intercepts */   

        rads = (double)angle * PI / 180.0; /* Convert angle to radians */   

        points[i].x = xcenter + (int)( cos(rads) * radius );  

        points[i].y = ycenter - (int)( sin(rads) * radius * AspectRatio );  

        angle += step; /* Move to next increment */   

    }  

    circle( xcenter, ycenter, radius ); /* Draw bounding circle */   

    for( i=0 ; i<MAXPTS ; ++i )  

    { /* Draw the cords to the circle */   

        for( j=i ; j<MAXPTS ; ++j )  

        { /* For each remaining intersect */   

            moveto(points[i].x, points[i].y); /* Move to beginning of cord */   

            lineto(points[j].x, points[j].y); /* Draw the cord */   

        }   

    }   

    system("pause"); 

    closegraph();

    return 0;  


推荐回答

还没有选出推荐答案,请稍候访问或查看其他回答!
以上问题属网友观点,不代表本站立场,仅供参考!