home *** CD-ROM | disk | FTP | other *** search
- Program ReadDef;
- Uses Graph;
- Var
- Gd : Integer;
- Gm : Integer;
- F : Text;
- Ch : Char;
- Col: Word;
- SX : Word;
- X,Y: Word;
- Begin
- Gd:=EGA;
- Gm:=EGAhi;
- InitGraph(Gd,Gm,''); (* Set path where EGAVGA.BGI*)
- (* is located *)
-
-
- SetFillStyle(SolidFill,Blue);
- Bar(0,0,639,349);
-
- X:=260;
- Y:=120; (* Starting position *)
-
-
- SX:=X;
- Assign(F,'rm.def'); (* Rm.def must be in current directory *)
- Reset(F);
- Repeat
- Ch:=' ';
- Repeat
- Read(F,Ch); (* Read a character *)
- Col:=0;
- Case Ord(Ch) of
- 48..57:Begin
- Col:=Ord(Ch)-48; (* Convert Hex character to *)
- PutPixel(SX,Y,Col); (* number. From 0 to 9 *)
- End;
- 65..70:Begin
- Col:=Ord(Ch)-55; (* Convert Hex character to *)
- PutPixel(SX,Y,Col); (* number. From 10 to 15 *)
- End;
- End;
- Inc(SX);
- Until Ch=chr(13);(* Repeat loop until we hit a carriage return *)
- Read(F,Ch); (* Should be a line feed, we just read it *)
- Inc(Y); (* Increase Y by 1 *)
- SX:=X; (* Set SX to X *)
- Until Eof(F); (* Keep repeating until we reach the end of the file *)
- Close(F);
-
- Readln; (* Wait for enter key *)
-
- Closegraph; (* Close graphics *)
-
- End.