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

  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include "pgl.h"
  4.    char string[9][20] = { "SOLID LINE",
  5.                           "HUGE DASH LINE",
  6.                           "LARGE DASH LINE",
  7.                           "MEDIUM DASH LINE",
  8.                           "SMALL DASH LINE",
  9.                           "WIDE DOT LINE",
  10.                           "CLOSE DOT LINE",
  11.                           "DASH DOT LINE",
  12.                           "CENTER LINE" };
  13.  
  14.  
  15. main()
  16.  
  17. {
  18.    int err=0, j, maxx, y;
  19.    pgInitDrw( "linepat.plt", 2000, 2000, &err );
  20.    if( err != 0 )
  21.    {
  22.       printf( "ERROR IN INITDRW ROUTINE" );
  23.       exit( 1 );
  24.    }
  25.    pgSetTextStyle( pgTRIPLEX );
  26.    pgSetTextJustify( pgCENTER, pgBOTTOM );
  27.    pgSetCharSpacing( 3 );
  28.    pgSetTextScaling( 2, 1, 2, 1 );
  29.  
  30.    maxx = pgGetMaxX();
  31. /*
  32.  *   Compare the different line styles.
  33. */
  34.    pgSetTextJustify( pgLEFT, pgBOTTOM );
  35.    pgSetColor( 1 );
  36.    y = 200;
  37.    for( j=0; j<9; j++ )
  38.    {
  39.       pgSetLineStyle( j, 10 );
  40.       pgSetLineWeight( 50 );
  41.       pgLine( 0, y, maxx/2, y );
  42.       pgDrawTextXY( maxx/2+100, y, string[j] );
  43.       y += 200;
  44.    }
  45.    pgEndDrw();
  46. }
  47.