PROGRAM   SetViewP ;
USES   Graph ;

VAR
   G_GraphDriver : Integer ;
   G_GraphMode   : Integer ;
BEGIN
   G_GraphDriver := Detect ;
   G_GraphMode   := Detect ;
   InitGraph ( G_GraphDriver , G_GraphMode , 'C:\Lib\BGI' );

   SetFillStyle ( LtSlashFill , Green );
   Bar ( 0,0  ,  GetMaxX,GetMaxY );

   SetViewPort ( 50,50  ,  300,150  , TRUE );
   ClearViewPort ;

   {----- Now, all Coords are relative to "WiewPort window" }
   Line ( 0,0  ,  200,50 );
   Rectangle ( 0,0  ,  200,50 );
   Circle ( 100,25  , 20 );

   SetFillStyle ( SolidFill , White );
   Bar ( 0,60  ,  200,70 );

   OutTextXY ( 0 , 80 , 'Hello World...Hello...' );

   ReadLn ;
   CloseGraph ;
END.
