Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <pgchart.h>
    short _FAR _pg_resetpalette( void );

Description:
    The _pg_resetpalette function resets the internal palette of the
    presentation graphics system to default values.  The palette controls
    the colors, line styles, fill patterns and plot characters used to
    display each series of data in a chart.  The default palette chosen is
    dependent on the current video mode.

Returns:
    The _pg_resetpalette function returns zero if successful; otherwise, a
    non-zero value is returned.

See Also:
    _pg_defaultchart, _pg_initchart, _pg_chart, _pg_chartms, _pg_chartpie,
    _pg_chartscatter, _pg_chartscatterms, _pg_getpalette, _pg_setpalette

Example:
    #include <graph.h>
    #include <pgchart.h>
    #include <string.h>
    #include <conio.h>

    #define NUM_VALUES 4

    char _FAR *categories[ NUM_VALUES ] = {
        "Jan", "Feb", "Mar", "Apr"
    };

    float values[ NUM_VALUES ] = {
        20, 45, 30, 25
    };

    char bricks[ 8 ] = {
        0xff, 0x80, 0x80, 0x80, 0xff, 0x08, 0x08, 0x08
    };

    main()
    {
        chartenv env;
        palettetype pal;

        _setvideomode( _VRES16COLOR );
        _pg_initchart();
        _pg_defaultchart( &env,
                          _PG_COLUMNCHART, _PG_PLAINBARS );
        strcpy( env.maintitle.title, "Column Chart" );
        /* get default palette and change 1st entry */
        _pg_getpalette( &pal );
        pal[ 1 ].color = 12;
        memcpy( pal[ 1 ].fill, bricks, 8 );
        /* use new palette */
        _pg_setpalette( &pal );
        _pg_chart( &env, categories, values, NUM_VALUES );
        /* reset palette to default */
        _pg_resetpalette();
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson