PROGRAM   GetImag_ ;
USES   Graph ;

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

   SetFillStyle ( SolidFill , White );
   Bar ( 0,0  ,  100,50 );
   SetColor ( Black );
   MoveTo ( 0,0 );   LineTo ( 100,50 );
   MoveTo ( 0,50 );   LineTo ( 100,0 );
   Circle ( 50,25  , 20 );

   G_ImageSize1 := ImageSize ( 0,0  ,  100,50 );
   GetMem ( G_ImagePtr1 , G_ImageSize1 );
   GetImage ( 0,0  ,  100,50  , G_ImagePtr1^ );

   PutImage ( 60,60  , G_ImagePtr1^ , NormalPut );

   FreeMem ( G_ImagePtr1 , G_ImageSize1 );

   ReadLn ;
END.
