home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / PGL.ZIP / PGLCS.ZIP / USERFILL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-02  |  2.0 KB  |  69 lines

  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include "pgl.h"
  4.    char fillstyle[3][20] = { "FILL 1",
  5.                              "FILL 2",
  6.                              "FILL 3" };
  7.    char oldfill[3][8];
  8.    char userfill[3][8] = { {0xFF,0x80,0x80,0x80,0xFF,0x08,0x08,0x08},
  9.                            {0xFF,0x88,0x88,0x88,0xFF,0x08,0x08,0x08},
  10.                            {0xFF,0x08,0x08,0x08,0xFF,0x08,0x08,0x08} };
  11.  
  12. main()
  13.  
  14. {
  15.    int color, err;
  16.                                     
  17.    pgInitDrw( "userfill.plt", 4000, 3000, &err );
  18.    if( err != 0 )
  19.    {
  20.       printf( "ERROR IN pgInitDrw ROUTINE" );
  21.       exit( 1 );
  22.    }
  23.    pgSetTextStyle( pgTRIPLEX );
  24.    pgSetTextJustify( pgCENTER, pgTOP );
  25.    pgSetCharSpacing( 3 );
  26.    pgSetTextScaling( 2, 1, 2, 1 );
  27.    pgSetColor( 15 );
  28.  
  29.    /* Display user fill 1 */
  30.     pgSetFillPattern( userfill[0], 1 );
  31.     pgRectangle( 100, 100, 900, 900, pgOFILL );
  32.     pgDrawTextXY( 500, 920, fillstyle[0] );
  33.  
  34.    /* Get old fill & color */
  35.     pgGetFillPattern( oldfill[0], &color );
  36.  
  37.    /* Display user fill 2 */
  38.     pgSetFillPattern( userfill[1], 1 );
  39.     pgRectangle( 1100, 100, 1900, 900, pgOFILL );
  40.     pgDrawTextXY( 1500, 920, fillstyle[1] );
  41.  
  42.    /* Get old fill & color */
  43.     pgGetFillPattern( oldfill[1], &color );
  44.  
  45.    /* Display user fill 3 */
  46.     pgSetFillPattern( userfill[2], 1 );
  47.     pgRectangle( 2100, 100, 2900, 900, pgOFILL );
  48.     pgDrawTextXY( 2500, 920, fillstyle[2] );
  49.  
  50.    /* Get old fill & color */
  51.     pgGetFillPattern( oldfill[2], &color );
  52.  
  53.    /* Display old fill 1 */
  54.     pgSetFillPattern( oldfill[0], color );
  55.     pgRectangle( 100, 1100, 900, 1900, pgOFILL );
  56.     pgDrawTextXY( 500, 1920, fillstyle[0] );
  57.  
  58.    /* Display old fill 2 */
  59.     pgSetFillPattern( oldfill[1], color );
  60.     pgRectangle( 1100, 1100, 1900, 1900, pgOFILL );
  61.     pgDrawTextXY( 1500, 1920, fillstyle[1] );
  62.  
  63.    /* Display old fill 3 */
  64.     pgSetFillPattern( oldfill[2], color );
  65.     pgRectangle( 2100, 1100, 2900, 1900, pgOFILL );
  66.     pgDrawTextXY( 2500, 1920, fillstyle[2] );
  67.    pgEndDrw();
  68. }
  69.