PROGRAM   TestClip ;
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 );

   {----- clip = False }
   SetViewPort ( 100,10  ,  200,110  , TRUE );
   ClearViewPort ;
   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...' );

   {----- clip = TRUE }
   SetViewPort ( 100,130  ,  200,230  , False );
   ClearViewPort ;
   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.
