/* ************************************************************ */
/* Demo1.c For Turbo C                                          */
/*                                                              */
/* TGCAR.XGF was created by saving the image as  TP/TC (Binary) */
/* from Raster Master.                                          */
/* ************************************************************ */

#include <stdio.h>
#include <alloc.h>
#include <graphics.h>

void main()
{
  void *imgBuf;
  FILE *F;
  int driver = VGA;
  int mode   = VGALO;
  unsigned int size;

  F=fopen("TGCAR.XGF","rb");
  size=filelength(fileno(F));
  imgBuf = malloc(size);
  fread(imgBuf,size,1,F);
  fclose(F);

  initgraph(&driver, &mode, "");
  setfillstyle(SOLID_FILL,BLUE);
  bar(0,0,getmaxx(),getmaxy());
  putimage(0,0,imgBuf,COPY_PUT);
  free(imgBuf);
  getch();
  closegraph();
}