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

  1. VOID DrawIt (HPS hps, SHORT cxClient, SHORT cyClient)
  2.      {
  3.      POINTL aptl[2] ;
  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.      aptl[0].x = rand() % cxClient ;                   // First corner
  11.      aptl[0].y = rand() % cyClient ;
  12.      GpiMove (hps, aptl) ;
  13.  
  14.      aptl[1].x = rand() % cxClient ;                   // Opposite corner
  15.      aptl[1].y = rand() % cyClient ;
  16.      GpiBox (hps, DRO_FILL, aptl + 1, labs (aptl[1].x - aptl[0].x),
  17.                                       labs (aptl[1].y - aptl[0].y)) ;
  18.      }
  19.