鱼C论坛

 找回密码
 立即注册
查看: 1787|回复: 4

关于C函数的图像有文件

[复制链接]
发表于 2014-11-24 13:37:20 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. #include <graphics.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <conio.h>

  5. int main(void)
  6. {
  7.    /* request auto detection */
  8.    int gdriver = DETECT, gmode, errorcode;
  9.    int midx, midy, i;

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

  12.    /* read result of initialization */
  13.    errorcode = graphresult();
  14.    if (errorcode != grOk)  /* an error occurred */
  15.    {
  16.       printf("Graphics error: %s\n", grapherrormsg(errorcode));
  17.       printf("Press any key to halt:");
  18.       getch();
  19.       exit(1); /* terminate with an error code */
  20.    }

  21.    midx = getmaxx() / 2;
  22.    midy = getmaxy() / 2;

  23.    /* loop through the fill patterns */
  24.    for (i=SOLID_FILL; i<USER_FILL; i++)
  25.    {
  26.       /* set the fill style */
  27.       setfillstyle(i, getmaxcolor());

  28.       /* draw the bar */
  29.       bar(midx-50, midy-50, midx+50,
  30.          midy+50);

  31.       getch();
  32.    }

  33.    /* clean up */
  34.    closegraph();
  35.    return 0;
  36. }
复制代码

这里面怎么说那个图像头文件找不到呀 是不是我那里弄错了 还是建文件建错了?
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2014-11-25 08:35:09 | 显示全部楼层
如果你使用的是VC6的话,是没有“graphics.h”的,其它版本VC不清楚,如果要用“graphics.h”的话,可以去下一个EasyX库使用,网址: http://www.easyx.cn/
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-11-26 10:53:43 | 显示全部楼层
风之残月 发表于 2014-11-25 08:35
如果你使用的是VC6的话,是没有“graphics.h”的,其它版本VC不清楚,如果要用“graphics.h”的话,可以去 ...

版主 我问下 这个图像函数是不是以后  比如游戏编程用到的特别多
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2014-11-26 21:16:21 | 显示全部楼层
woaini92887 发表于 2014-11-26 10:53
版主 我问下 这个图像函数是不是以后  比如游戏编程用到的特别多

不清楚,你可以去看看游戏编程相关的书
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2014-12-1 12:58:29 | 显示全部楼层
下一个EasyX库使用
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-18 06:41

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表