home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / EN0720.ZIP / FIGURE7.C < prev    next >
Text File  |  1988-08-01  |  874b  |  26 lines

  1. VOID DrawIt (HPS hps, SHORT cxClient, SHORT cyClient)
  2.      {
  3.      POINTL ptl ;
  4.  
  5.      GpiSetPattern (hps, 1L + rand() % 16) ;           // Pattern = 1 to 16
  6.      GpiSetColor (hps, (LONG) (rand() % 16)) ;         // Color = 0 to 15
  7.      GpiSetBackColor (hps, (LONG) (rand () % 16)) ;    // Background color
  8.      GpiSetBackMix (hps, BM_OVERPAINT) ;               // Background mix
  9.  
  10.      GpiBeginArea (hps, BA_NOBOUNDARY) ;
  11.  
  12.      ptl.x = rand() % cxClient ;                       // First corner
  13.      ptl.y = rand() % cyClient ;
  14.      GpiMove (hps, &ptl) ;
  15.  
  16.      ptl.x = rand() % cxClient ;                       // Second corner
  17.      ptl.y = rand() % cyClient ;
  18.      GpiLine (hps, &ptl) ;
  19.  
  20.      ptl.x = rand() % cxClient ;                       // Third corner
  21.      ptl.y = rand() % cyClient ;
  22.      GpiLine (hps, &ptl) ;
  23.  
  24.      GpiEndArea (hps) ;
  25.      }
  26.