/*★ C言語のイメージファイルを表示する 前田 稔 ★*/
#include <stdio.h>
#include <graph.h>
#include <io.h>
#include <fcntl.h>
int FD;
char buf[10000L];
/*★ MAIN PROGRAM ★*/
int main()
{
if ((FD= open("C_ENEMY.IMG",O_RDONLY|O_BINARY))==-1)
{ printf("file open error\n"); return(1); }
if (read(FD,buf,10000L)==-1)
{ printf("file read error\n"); close(FD); return(1); }
close(FD);
//スクリーンの表示モードの設定
if (!_setvideomode(_MAXRESMODE)) return(1);
_putimage(100,50,buf,_GPSET); //イメージを表示
_getch(); //どれかキーを押すと終了
_setvideomode(_DEFAULTMODE);
return(0);
}
|