home *** CD-ROM | disk | FTP | other *** search
-
- Program WriteXgf;
- Uses Graph;
- Var
- F : File;
- Img : Pointer;
- Size : Word;
- 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);
-
- SetFillStyle(SlashFill,LightGray);
- Bar(2,2,49,49);
- SetColor(White);
- Rectangle(1,1,50,50);
- SetColor(LightGreen);
- OutTextXY(2,10,'RASTER');
- OutTextXY(2,30,'MASTER'); (* Draw something *)
-
- Size:=ImageSize(1,1,50,50);
- GetMem(Img,Size);
- GetImage(1,1,50,50,Img^); (* Grab the image from screen*)
- (* and store in Img buffer *)
- Assign(F,'BOX.XGF');
- ReWrite(F,1);
- BlockWrite(F,Img^,Size);
- Close(F); (* Save the Image *)
-
- FreeMem(Img,Size); (* Release the memory *)
- ReadLn; (* Wait for enter key *)
- CloseGraph; (* Close graphics *)
- End.