home *** CD-ROM | disk | FTP | other *** search
- VOID DrawIt (HPS hps, SHORT cxClient, SHORT cyClient)
- {
- POINTL aptl[2] ;
- SHORT x1, x2, y1, y2 ;
-
- 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
-
- x1 = rand() % cxClient ;
- x2 = rand() % cxClient ;
- y1 = rand() % cyClient ;
- y2 = rand() % cyClient ;
-
- aptl[0].x = min (x1, x2) ; // Lower left corner
- aptl[0].y = min (y1, y2) ;
- aptl[1].x = max (x1, x2) ; // Upper right corner
- aptl[1].y = max (y1, y2) ;
-
- GpiBitBlt (hps, NULL, 2L, aptl, ROP_PATCOPY, 0L) ;
- }
-