home *** CD-ROM | disk | FTP | other *** search
- VOID DrawIt (HPS hps, SHORT cxClient, SHORT cyClient)
- {
- POINTL aptl[2] ;
-
- GpiSetPattern (hps, 1L + rand() % 16) ; // Pattern = 1 to 16
- GpiSetColor (hps, (LONG) (rand() % 16)) ; // Color = 0 to 15
- GpiSetBackColor (hps, (LONG) (rand () % 16)) ; // Background color
- GpiSetBackMix (hps, BM_OVERPAINT) ; // Background mix
-
- aptl[0].x = rand() % cxClient ; // First corner
- aptl[0].y = rand() % cyClient ;
- GpiMove (hps, aptl) ;
-
- aptl[1].x = rand() % cxClient ; // Opposite corner
- aptl[1].y = rand() % cyClient ;
- GpiBox (hps, DRO_FILL, aptl + 1, labs (aptl[1].x - aptl[0].x),
- labs (aptl[1].y - aptl[0].y)) ;
- }
-