home *** CD-ROM | disk | FTP | other *** search
- #include <stdlib.h>
- #include <stdio.h>
- #include "pgl.h"
- char fillstyle[3][20] = { "FILL 1",
- "FILL 2",
- "FILL 3" };
- char oldfill[3][8];
- char userfill[3][8] = { {0xFF,0x80,0x80,0x80,0xFF,0x08,0x08,0x08},
- {0xFF,0x88,0x88,0x88,0xFF,0x08,0x08,0x08},
- {0xFF,0x08,0x08,0x08,0xFF,0x08,0x08,0x08} };
-
- main()
-
- {
- int color, err;
-
- pgInitDrw( "userfill.plt", 4000, 3000, &err );
- if( err != 0 )
- {
- printf( "ERROR IN pgInitDrw ROUTINE" );
- exit( 1 );
- }
- pgSetTextStyle( pgTRIPLEX );
- pgSetTextJustify( pgCENTER, pgTOP );
- pgSetCharSpacing( 3 );
- pgSetTextScaling( 2, 1, 2, 1 );
- pgSetColor( 15 );
-
- /* Display user fill 1 */
- pgSetFillPattern( userfill[0], 1 );
- pgRectangle( 100, 100, 900, 900, pgOFILL );
- pgDrawTextXY( 500, 920, fillstyle[0] );
-
- /* Get old fill & color */
- pgGetFillPattern( oldfill[0], &color );
-
- /* Display user fill 2 */
- pgSetFillPattern( userfill[1], 1 );
- pgRectangle( 1100, 100, 1900, 900, pgOFILL );
- pgDrawTextXY( 1500, 920, fillstyle[1] );
-
- /* Get old fill & color */
- pgGetFillPattern( oldfill[1], &color );
-
- /* Display user fill 3 */
- pgSetFillPattern( userfill[2], 1 );
- pgRectangle( 2100, 100, 2900, 900, pgOFILL );
- pgDrawTextXY( 2500, 920, fillstyle[2] );
-
- /* Get old fill & color */
- pgGetFillPattern( oldfill[2], &color );
-
- /* Display old fill 1 */
- pgSetFillPattern( oldfill[0], color );
- pgRectangle( 100, 1100, 900, 1900, pgOFILL );
- pgDrawTextXY( 500, 1920, fillstyle[0] );
-
- /* Display old fill 2 */
- pgSetFillPattern( oldfill[1], color );
- pgRectangle( 1100, 1100, 1900, 1900, pgOFILL );
- pgDrawTextXY( 1500, 1920, fillstyle[1] );
-
- /* Display old fill 3 */
- pgSetFillPattern( oldfill[2], color );
- pgRectangle( 2100, 1100, 2900, 1900, pgOFILL );
- pgDrawTextXY( 2500, 1920, fillstyle[2] );
- pgEndDrw();
- }