c下的图形文件.txt
gtk windows mfc class api #include <stdio.h> #include <graphics.h> int main() { int i ,gdriver,gmode , size; void *buf; gdriver=DETECT; initgraph(&gdriver,&gmode) ; // init graph system setbkcolor(BLUE); //set back color setlinestyle(0,0,1); //set line style setfillstyle(1,10); //set fill style circle(100,200,30); // pain a circle on the screen floodfill(100,200,12); //fill the , black to be a circle size=imagesize(69,131,231); buf=malloc(size); //allocation memory that get from the imagesize function getimage(69,169,131,231,buf); //to save the buffer of graph to the buf putimage(500,269,buf,COPY_PUT); // put the buffer to show out for(i=0;i<185;i++) { putimage(70+i,170,buf,COPY_PUT); // change the coordinate putimage(500-i,170,buf,COPY_PUT); } for(i=0;i<185;i++) { putimage(255-i,170,buf,COPY_PUT); //change the coordinate putimage(315+i,170,buf,COPY_PUT); } getch(); //hit a key to halt closegraph(); //close the graph system return 0 ; // end the programing }
^_^ 此教程由山东德州思蓝软件公司提供^_^
(谨此给拥有linux精神的人,为中国软件的崛起而奋斗!!!)
c 语言下的图形环境
gtk windows
mfc class api
#include <stdio.h>
#include <graphics.h>
int main()
{
int i ,gdriver,gmode , size;
void *buf;
gdriver=DETECT;
initgraph(&gdriver,&gmode) ; // init graph system
setbkcolor(BLUE); //set back color
setlinestyle(0,0,1); //set line style
setfillstyle(1,10); //set fill style
circle(100,200,30); // pain a circle on the screen
floodfill(100,200,12); //fill the , black to be a circle
size=imagesize(69,131,231);
buf=malloc(size); //allocation memory that get from the imagesize function
getimage(69,169,131,231,buf); //to save the buffer of graph to the buf
putimage(500,269,buf,COPY_PUT); // put the buffer to show out
for(i=0;i<185;i++)
{
putimage(70+i,170,buf,COPY_PUT); // change the coordinate
putimage(500-i,170,buf,COPY_PUT);
}
- 粉丝: 0
- 资源: 1
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助