C语言函数—poke

函数名

pieslice

功 能

绘制并填充一个扇形

用 法

void far pieslice(int x, int stanle, int endangle, int radius);

程序例

#include <graphics.h> 
#include <stdlib.h> 
#include <stdio.h> 
#include <conio.h> 

int main(void) 
{ 
   /* request auto detection */ 
   int gdriver = DETECT, gmode, errorcode; 
   int midx, midy; 
   int stangle = 45, endangle = 135, radius = 100; 

   /* initialize graphics and local variables */ 
   initgraph(&gdriver, &gmode, ""); 

   /* read result of initialization */ 
   errorcode = graphresult(); 
   if (errorcode != grOk)  /* an error occurred */ 
   { 
      printf("Graphics error: %sn", grapherrormsg(errorcode)); 
      printf("Press any key to halt:"); 
      getch(); 
      exit(1); /* terminate with an error code */ 
   } 

   midx = getmaxx() / 2; 
   midy = getmaxy() / 2; 

   /* set fill style and draw a pie slice */ 
   setfillstyle(EMPTY_FILL, getmaxcolor()); 
   pieslice(midx, midy, stangle, endangle, radius); 

   /* clean up */ 
   getch(); 
   closegraph(); 
   return 0; 
} 
  
  

如果引用本站的原创文章,请注明原文链接:,本站保留追究责任的权利!