pieslice
程序语言
pieslice是一个程序语言,功能是绘制并填充一个扇形。
程序例:
#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 */
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;
参考资料
最新修订时间:2023-12-31 14:18
目录
概述
参考资料