home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 10-17.C < prev    next >
Text File  |  1995-01-20  |  1KB  |  52 lines

  1. #include <fastgraf.h>
  2.  
  3. void main(void);
  4.  
  5. char source[64*40], dest[74*50];
  6.  
  7. void main()
  8. {
  9.    /* initialize the video environment */
  10.  
  11.    fg_initpm();
  12.    fg_setmode(19);
  13.  
  14.    /* draw a blue rectangle with a thick white border */
  15.  
  16.    fg_setcolor(9);
  17.    fg_rect(0,63,0,39);
  18.    fg_setcolor(15);
  19.    fg_boxdepth(5,5);
  20.    fg_box(0,63,0,39);
  21.    fg_move(32,20);
  22.    fg_justify(0,0);
  23.    fg_print("SCALE",5);
  24.  
  25.    /* retrieve the rectangle as a mode-specific bitmap */
  26.  
  27.    fg_move(0,39);
  28.    fg_getimage(source,64,40);
  29.    fg_waitkey();
  30.  
  31.    /* expand the bitmap by 10 pixels in each direction and   */
  32.    /* then display it in the lower left corner of the screen */
  33.  
  34.    fg_move(0,199);
  35.    fg_scale(source,dest,64,40,74,50);
  36.    fg_putimage(dest,74,50);
  37.    fg_waitkey();
  38.  
  39.    /* reduce the original bitmap by 50% in each direction and */
  40.    /* then display it in the lower right corner of the screen */
  41.  
  42.    fg_move(288,199);
  43.    fg_scale(source,dest,64,40,32,20);
  44.    fg_putimage(dest,32,20);
  45.    fg_waitkey();
  46.  
  47.    /* restore 80x25 text mode and exit */
  48.  
  49.    fg_setmode(3);
  50.    fg_reset();
  51. }
  52.