home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1990 / 01 / tricks / b_l_demo.c next >
Encoding:
C/C++ Source or Header  |  1989-10-10  |  1.0 KB  |  36 lines

  1. /* ------------------------------------------------------ */
  2. /*                 B_L-DEMO.C                             */
  3. /* ------------------------------------------------------ */
  4. #include <graphics.h>
  5. #include <stdio.h>
  6. #include "b_l-save.inc"
  7.  
  8. main()
  9. {
  10.   int graphdriver, graphmode;
  11.   graphdriver = CGA;
  12.   graphmode   = CGAC0;
  13.   initgraph(&graphdriver, &graphmode,"");
  14.   printf("Abbruch der Zeichnung und speichern\n");
  15.   printf("mit einem Tastendruck");
  16.   delay(3000);
  17.   clearviewport();
  18.   while (!kbhit())          /* ein bunter Sternenhimmel */
  19.     putpixel(rand() % getmaxx(), rand() % getmaxy(),
  20.              1 + rand() % getmaxcolor());
  21.   getch();
  22.  
  23.   bsave("test.img");
  24.   clearviewport();
  25.   printf("\nnun wird das Bild wieder geladen");
  26.   delay(5000);
  27.   clearviewport();
  28.   bload("test.img");
  29.   delay(5000);
  30.   clearviewport();
  31.   clearviewport();
  32.   getch();
  33.   closegraph;
  34. }
  35. /* ------------------------------------------------------ */
  36. /*                   B_L-DEMO.C                           */