home *** CD-ROM | disk | FTP | other *** search
- Program ReadXgf;
- Uses Graph;
- Var
- F : File;
- Img : Pointer;
- Size : LongInt;
- Gd : Integer;
- Gm : Integer;
- Begin
- Gd:=EGA;
- Gm:=EGAHi;
- InitGraph(Gd,Gm,''); (* Set path where EGAVGA.BGI *)
- (* is located *)
-
- SetFillStyle(SolidFill,Blue);
- Bar(0,0,639,349);
-
- Assign(F,'GCAR.XGF'); (* Gcar.xgf must be in current directory *)
- Reset(F,1);
- Size:=FileSize(F); (* Get size of file, must 64K or less *)
- GetMem(Img,Size); (* Allocate memory *)
- BlockRead(F,Img^,Size); (* Read contents of file into buffer *)
- Close(F);
-
- PutImage(300,150,Img^,NormalPut); (* Display image *)
- FreeMem(Img,Size); (* Free memory *)
- Readln; (* Wait for enter key *)
- CloseGraph; (* Close graphics *)
- End.