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

  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include "pgl.h"
  4.    char string[12][20] = { "EMPTY FILL",
  5.                            "SOLID FILL",
  6.                            "LINE FILL",
  7.                            "LTSLASH FILL",
  8.                            "SLASH FILL",
  9.                            "BKSLASH FILL",
  10.                            "LTBKSLASH FILL",
  11.                            "HATCH FILL",
  12.                            "XHATCH FILL",
  13.                            "INTERLEAVE FILL",
  14.                            "WIDEDOT FILL",
  15.                            "CLOSEDOT FILL" };
  16.  
  17.  
  18. main()
  19.  
  20. {
  21.    int err=0, j, dx;
  22.    pgInitDrw( "fillpat.plt", 4000, 3000, &err );
  23.    if( err != 0 )
  24.    {
  25.       printf( "ERROR IN INITDRW ROUTINE" );
  26.       exit( 1 );
  27.    }
  28.    pgSetTextStyle( pgTRIPLEX );
  29.    pgSetTextJustify( pgCENTER, pgTOP );
  30.    pgSetCharSpacing( 3 );
  31.    pgSetTextScaling( 2, 1, 2, 1 );
  32.    pgSetColor( 15 );
  33.  
  34.    for( j=0; j<4; j++ )
  35.    {
  36.       dx = j * 1000;
  37.       pgSetFillStyle( j, 1 );
  38.       pgRectangle( 100+dx, 100, 900+dx, 900, pgOFILL );
  39.       pgDrawTextXY( 500+dx, 920, string[j] );
  40.    }
  41.  
  42.    for( j=4; j<8; j++ )
  43.    {
  44.       dx = (j-4) * 1000;
  45.       pgSetFillStyle( j, 1 );
  46.       pgRectangle( 100+dx, 1100, 900+dx, 1900, pgOFILL );
  47.       pgDrawTextXY( 500+dx, 1920, string[j] );
  48.    }
  49.  
  50.    for( j=8; j<12; j++ )
  51.    {
  52.       dx = (j-8) * 1000;
  53.       pgSetFillStyle( j, 1 );
  54.       pgRectangle( 100+dx, 2100, 900+dx, 2900, pgOFILL );
  55.       pgDrawTextXY( 500+dx, 2920, string[j] );
  56.    }
  57.    pgEndDrw();
  58. }
  59.